vecnorm seems slower than it should be
Show older comments
In the speed comparison below, I would expect vecnorm() to be faster than the first version, because the first version creates an A-sized temporary matrix. However, vecnorm() is significantly slower. Any thoughts as to why this is?
A=rand(1e4,1000)-0.5;
tic
x1=mean(abs(A),2);
toc;
tic;
x2=vecnorm(A,1,2)./size(A,2);
toc
Accepted Answer
More Answers (0)
Categories
Find more on Ordinary Differential Equations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!