Evaluating 2D function on 2D grid without using "for" loops
49 views (last 30 days)
I have a function f(x,y) and I want to evaluate it on x,y grid. For example,
f = @(x,y) x^2+y^2;
x = 1:10;
y = 1:5;
%one way to do it is using for loops.
result(x,y) = f(x,y);
Is there any way do it without using "for" loops?