MATLAB Answers

Issue in To workspace block in 2019b

조회 수: 423(최근 30일)
Moreshwar Inamdar
Moreshwar Inamdar 5 Dec 2019
댓글: Fangjun Jiang 24 Sep 2020
I have a simulink model which uses to workspace block. The to workspace block is set to a 'array' that outputs variable in to my matlab workspace window. When I run the model, it runs and output on matlab workspace occure as out which gives 1*1 simulationout structure and there is my variable and I am unable to getting this variable but with lower version of matlab I were directly getting array variable how should I solve this problem?

  댓글 수: 0

댓글을 달려면 로그인하십시오.


Fangjun Jiang
Fangjun Jiang 5 Dec 2019
Drag a "To Workspace" block from the library, if you only change the fomat from "Timeseries" to "array", then the variable in the workspace is out.simout

  댓글 수: 6

표시 이전 댓글 수: 3
Fangjun Jiang
Fangjun Jiang 6 Dec 2019
That is correct. When you specify the variable name "simout" in the "To Workspace" block, it used to be the data will be saved to variable "simout". Now it is saved in the structure "out.simout". This change happened in R2019b.
This is better. Easier to organize data. Avoid overwriting when there is a signal object in workspace but user wants to save the log with the signal name.
Yuguang Fu
Yuguang Fu 24 Sep 2020
Hello, I have similar issue about "to workspace" block in R2019b.
As you mentioned, the data is saved in "out.simout".
But if I run the model as "sim model.slx" in the script, the output doesn't show up in the workspace. Unless I "click Run buttom" in the Simulink, I can find the data in the workspace.
Could you help to address that?
Fangjun Jiang
Fangjun Jiang 24 Sep 2020
assign a return variable, Result=sim('model.slx');

댓글을 달려면 로그인하십시오.





Community Treasure Hunt

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

Start Hunting!

Translated by