I'd like to know if there is any more efficient way to do the following in matlab
[K, L] = meshgrid(1:sh,1:sv);
for i = 1 : sv
for j = 1 : sh
M = score_mat_temp + a*((K-j).*(K-j) + b*(K-j)) + c*((L-i).*(L-i) + d*(L-i)) + e;
end
end
Because it is ultra slow right now with sv and sh typically of the order of 500
thanks a lot !
score_mat_temp = score_mat_temp + a*...? Or else, your question doesn't make much sense... - Stewie Griffin