what is the problem with the following code?
f=input('enter function: ','s')[DX,DY] = -gradient(f);f = str2func(['@(x,y)' vectorize(f)]);[DX,DY] = -gradient(f);hold onquiver(X,Y,DX,DY)hold off
I get the following errors:
Error using zeros CLASSNAME input must be a valid numeric or logical class name.
Error in gradient (line 56) g = zeros(size(f),class(f)); % case of singleton dimension
Best Answer