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

4 ビュー (過去 30 日間)
Austin Vander Linden 2019 年 11 月 22 日
コメント済み: Austin Vander Linden 2019 年 11 月 22 日
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

#### 0 件のコメント

サインイン to comment.

### 採用された回答

madhan ravi 2019 年 11 月 22 日

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.

#### 2 件のコメント

Austin Vander Linden 2019 年 11 月 22 日
I appreciate the help, however I'm still getting the same error.
Austin Vander Linden 2019 年 11 月 22 日
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 !

サインイン to comment.

### その他の回答 (0 件)

サインイン してこの質問に回答します。

R2019b