フィルターのクリア

how to plot struct data?

10 ビュー (過去 30 日間)
sellyEpp
sellyEpp 2014 年 8 月 6 日
コメント済み: Fernando Belda 2021 年 11 月 4 日
Hi, I am running a simulation in Simulink and using a to workspace block,to view the results also in the workspace. what I get as results in my workspace is an output with the name of my block, "simout", which is a 1*1 struct and a "tout" which is double. how can I plot my "simout"?

採用された回答

Christopher Berry
Christopher Berry 2014 年 8 月 6 日
The simout structure has simout.signals, simout.time and simout.blockName fields. The simout.signals field also has a simout.signals.values field, which holds your sampled data.
Further, if you selected 'Structure With Time' in your 'To Workspace' block, then the time field will be populated and the easiest way to plot it is like this:
>> plot(simout.time,simout.signals.values)
Otherwise, simout.time is left empty and you should just use the tout vector for your time variable like this:
>> plot(tout,simout.signals.values)
  2 件のコメント
sellyEpp
sellyEpp 2014 年 8 月 6 日
Thanks, selecting 'Structure With Time' worked for me!
Fernando Belda
Fernando Belda 2021 年 11 月 4 日
Hi! I have a similar case, but i would like also plot the title of each signal, so in the figure appear not only the values of every signal, but also the name of it. How can this be done?
Thank you in advice!

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

その他の回答 (2 件)

AJ
AJ 2015 年 10 月 15 日
Thanks for this. Helped out a lot!!

Ardalan Sabamehr
Ardalan Sabamehr 2016 年 4 月 21 日
Hi,
I got the output file from Complex continuous Morlet wavelet and it saved in work space as a struct file that I want to convert the file (scale to frequency) but it is block , How I can move my struct file to normal file in work space that I can plot them.
Thanks,

カテゴリ

Help Center および File ExchangeSignal Attributes and Indexing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by