The function is:
x = -10:10;y = -5:5;for j = 1:21 for i = 1:11 f(i) = - 20 * exp( - 0.2 * sqrt( ( 1/2 ) * sum( x(j)^2 + y(i)^2 ) ) ); end z(j,:) = f;end
Thanks!
for loopfunctionplotvectorvectorization
x = -10:10;y = -5:5;for j = 1:21 for i = 1:11 f(i) = - 20 * exp( - 0.2 * sqrt( ( 1/2 ) * sum( x(j)^2 + y(i)^2 ) ) ); end z(j,:) = f;end
Best Answer