Simulink Variables to Workspace

28 ビュー (過去 30 日間)
Evangelos Rompogiannakis
Evangelos Rompogiannakis 2020 年 11 月 26 日
回答済み: Rhea Chandy 2020 年 11 月 30 日
Hello everyone
I am using Simulink to obtain results and plot them in MATLAB. The transfer function is made in MATLAB and then I used and LTI block to assign the tf in the block. I used to workspace blocks to receive my output back in MATLAB. For some reason when I run the program, I can see my output variables in my workspace. I can use the command office to see the values but when I try to plot my results or use them in MATLAB EDITOR the results disappear, and I need to run the Simulink program again. I have the MATLAB R2020b version. The error that come out is *Unrecognized function or variable "name of variable" *
Please can someone help me because I need to do multiple plots for different step inputs and till now, I copy the values of every variable and use them with excel to create my graphs.
Thank you

採用された回答

Rhea Chandy
Rhea Chandy 2020 年 11 月 30 日
The To Workspace block typically writes data to the MATLAB® base workspace. For example, when you specify the variable name "simout" in the "To Workspace" block, the data is saved in the structure "out.simout". Possibly to avoid the error (Unrecognized function or variable "name of variable" ), try using plot(out.simout), rather than plot(simout).
It may be useful for you to save the workspace variables to a file (MAT-file), using the save function in order for you to use in multiple plots. You can also log this data into a MAT-file by changing the model configuration settings,ie. enabling the MAT-file logging parameter in Configuration Parameters.

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by