Is element-wise multiplication or element-wise squaring faster?
显示 更早的评论
I have a matrix A for which I need its individual elements squared. Which of the following is faster?
% This... >> B = A .* A;
% Or this? >> B = A .^ 2;
Anyone know which of these is faster? Some initial tests suggest the direct squaring is marginally faster... but I'd like to know why.
Thanks!
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Profile and Improve Performance 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!