---------- % Is it the same for this case? ---------- n = 200; % depending on the computer it might be m = 1000*n; % that n needs to be chosen differently A = randn(n,m); x = randn(n,1); p = zeros(m,1); q = zeros(1,m); tic; for i = 1:m p(i) = sum(x.*A(:,i)); q(i) = sum(x.*A(:,i)); end time = toc; disp(['time = ',num2str(time)]);
source share