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!
Best Answer