# Error using fsurf (too many functions) but success using ezsurf

4 views (last 30 days)
When using the fsurf command to plot this function, I recieve the message: "error using fsurf, too many functions."
By simply changing "fsurf" to "ezsurf" I successfully get my 4 figures (intended to model tumors).
I understand there is a difference in the plotting methods of fsurf and ezsurf, and I assume that fsurf, if correctly used, would give me more detailed figures. What could be causing the discrepancy? I appreciate any and all help!
syms u v
for a = 3:4
for b = 5:6
figure
fsurf((1+1/5*sin(a*u)*sin(b*v))*sin(v)*cos(u),(1+1/5*sin(a*u)*sin(b*v))*sin(v)*sin(u),(1+1/5*sin(a*u)*sin(b*v))*cos(v),[0 2*pi 0 pi])
end
end

madhan ravi on 22 Nov 2019
Edited: madhan ravi on 22 Nov 2019
Just vectorize the function and use function handles. To learn the proper usage of the functions that get you into a dilemma is to read the documentation page of the function.
fsurf(@(u,v)(1+1/5*sin(a*u).*sin(b*v)).*sin(v).*cos(u),(1+1/5*sin(a*u).*sin(b*v)).*sin(v).*sin(u),(1+1/5*sin(a*u).*sin(b*v)).*cos(v),[0 2*pi 0 pi]) % just alter your line to this line
doc fsurf % to open the documentation of the function
However I'm not getting the same error message that you're getting and it's not familiar.

Austin Vander Linden on 22 Nov 2019
I appreciate the help, however I'm still getting the same error.
Austin Vander Linden on 22 Nov 2019
Update- I opened a fresh instance of matlab and the command works perfectly. I'm unsure what was causing the error message, but I'm fine now. Thank you !