Community Profile

photo

TaipanRex


Active since 2019

Followers: 0   Following: 0

Statistics

Feeds

View by

Question


Why is manually adding elements of a vector faster than passing a vector range to sum()?
>> v1 = [1,2,3,4,5]; >> tic;for i=1:10000000; sum(v1(2:5)); end;toc; Elapsed time is 1.832466 seconds. >> tic;for i=1:1000000...

ongeveer 5 jaar ago | 1 answer | 0

1

answer