It's ok to use plot3 in MATLAB script,problems comes when I try to packet them in my function ‘PlotDampRoots’:says plot3 not defined.what suppose I do?

3 件のコメント

Torsten
Torsten 2024 年 5 月 7 日
How do you call "PlotDampRoots" ? What's the value for "omegan" that you use ?
jilei liu
jilei liu 2024 年 5 月 8 日
I call it in a slider Callback function “omegan_Callback”,"omegan" = the slider value,I want the plot updated when I change “omegan”
DGM
DGM 2024 年 5 月 8 日
For clarity:

サインインしてコメントする。

 採用された回答

Steven Lord
Steven Lord 2024 年 5 月 8 日

0 投票

Based on the translation of the Code Analyzer message DGM posted, it seems that somewhere in the PlotDampRoots function you assign to a variable named plot3. If you do that you will not be able to call the plot3 function inside that function (even if the attempted function call occurs before the assignment to the variable in the file.) Search the function for where you assign to plot3 and rename that variable.

3 件のコメント

jilei liu
jilei liu 2024 年 5 月 9 日
Thanks for you guys help,It's weird when Code Analyzer post that message since I‘ll never name variables with any key words like “plot3” etc.And I have followed your instructions to search in all files, “plot3” only show up in "PlotDampRoots.m",so I'm sure there is't any variable called ’plot3‘ by accident.when I run my GUI,message in command window says "Unrecognized function or variable 'plot3'."It seems MATLAB try to recognize plot3 as functions but failed.I can't figure it out.
Torsten
Torsten 2024 年 5 月 9 日
You set plot3(x,y,z) = 5 in line 32 of PlotDampRoots. That's very bad.
jilei liu
jilei liu 2024 年 5 月 10 日
oh my god,My head is sticky,Thanks for you guys help!Finally I got the beautiful correct figure I want.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeGraphics Objects についてさらに検索

質問済み:

2024 年 5 月 7 日

コメント済み:

2024 年 5 月 10 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by