Optimizing the value N to split arrays up for vectorizing an array so it runs the quickest
问题 I'm trying to optimizing the value N to split arrays up for vectorizing an array so it runs the quickest on different machines. I have some test code below #example use random values clear all, t=rand(1,556790); inner_freq=rand(8193,6); N=100; # use N chunks nn = int32(linspace(1, length(t)+1, N+1)) aa_sig_combined=zeros(size(t)); total_time_so_far=0; for ii=1:N tic; ind = nn(ii):nn(ii+1)-1; aa_sig_combined(ind) = sum(diag(inner_freq(1:end-1,2)) * cos(2 .* pi .* inner_freq(1:end-1,1) * t(ind)