フィルターのクリア

how do i plot a XYZ graph using simulink

185 ビュー (過去 30 日間)
pravin behera
pravin behera 2015 年 4 月 17 日
編集済み: Lalit Kumar 2020 年 2 月 25 日
I have 3 variables which are varying, and i have to plot them in a 3D plot, in matlab simulink we have XY graph, is there any way to plot XYZ graph??, please help...

採用された回答

Sebastian Castro
Sebastian Castro 2015 年 4 月 17 日
編集済み: Sebastian Castro 2015 年 4 月 17 日
There's no off-the-shelf block to do this, but you could always use your own MATLAB code to do this plotting.
If you want the plot to update as you go, you can use a MATLAB Function block.
If you're fine with the plot coming up at the end of simulation, you could create a StopFcn model callback which runs MATLAB code after simulation.
... or, you could simply use this 3DScope File Exchange link (NOTE: This doesn't work in R2014b and later because of the new MATLAB graphics system).
- Sebastian
  3 件のコメント
Sebastian Castro
Sebastian Castro 2015 年 4 月 17 日
Well, you can log your simulation data from the Configuration Parameters' "Data Import/Export" pane. Or, you can use "To Workspace" blocks if that's easier for you.
Supposing you go through that logged data and pick out the X, Y, and Z data into vectors, the MATLAB code is simply:
plot3(X,Y,Z);
... plus whatever line/marker, color/size, title/label/legend things you want to set up.
Giampiero Campa
Giampiero Campa 2017 年 12 月 2 日
Note that the 3DScope has been now updated so it works for all versions from 2014b and later. Also the legacy code had been provided so it works on versions prior to 14b.

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

その他の回答 (1 件)

Lalit Kumar
Lalit Kumar 2020 年 2 月 25 日
編集済み: Lalit Kumar 2020 年 2 月 25 日

カテゴリ

Help Center および File ExchangeView and Analyze Simulation Results についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by