Data logging to workspace using to workspace block in fast restart mode

10 ビュー (過去 30 日間)
Muhammad Ahsan Zamee
Muhammad Ahsan Zamee 2019 年 8 月 28 日
編集済み: Peter Oswald 2023 年 2 月 1 日
I have been trying to send data to workspace using 'to workspace' block in fast restart mode. but workspace fails to get anything. A variable nam 'SimulationOutput' does appears, but this one is completely empty. Thus cant get any data to process. any help will be highly appreciated!
Thanks

回答 (1 件)

Urmila Rajpurohith
Urmila Rajpurohith 2019 年 9 月 9 日
Hi Muhammad,
You can follow the below steps to access results of a simulation of a model with “to workspace “block in fast restart mode.
simOut = sim('modelname’, 'StopTime', '10');
output= get(simOut, 'simout');
here “simout” is the variable name provided in “to workspace” Block parameters.
values=output.signals.values;
You can refer to below documentation for more information.https://www.mathworks.com/help/simulink/slref/simulink.simulationoutput-class.html
  2 件のコメント
Mohamed Numair
Mohamed Numair 2022 年 9 月 5 日
That was helpful, but for me I have multiple "to workspace" blocks in my model. Is there an efficient way instead of repeating this line for the number of variables (I have over 25 variables)
output= get(simOut, 'simout');
and to get them exported as would have normally happened if were without fast restart?
Peter Oswald
Peter Oswald 2023 年 2 月 1 日
編集済み: Peter Oswald 2023 年 2 月 1 日
Unfortunately I have the exact same problem. I need to send different data to the workspace but would like to run the 'Fast Restart' Mode. The Compiling takes too long.
Best regards from Bavaria,
Peter.

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

カテゴリ

Help Center および File ExchangeSources についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by