matlab constant anonymous function returns only one value instead of an array
- by Filo
I've been searching the net for a couple of mornings and found nothing, hope you can help.
I have an anonymous function like this
f = @(x,y) [sin(2*pi*x).*cos(2*pi*y), cos(2*pi*x).*sin(2*pi*y)];
that needs to be evaluated on an array of points, something like
x = 0:0.1:1;
y = 0:0.1:1;
w = f(x',y');
Now, in the above example everything works…