Issue in To workspace block in 2019b

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?

Answers (2)

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

7 Comments

Similarly I have done but as my simulation get stop as my reaching condition occur so due to that answer 'ans type(strut)' get created whose elements are time, my variable array which were not occuring in my previous MATLAB version.
And to access that 'ans (strut)'I used 'ans.variable name' but it require works only in command window not in MATLAB script.
can't really understand you. What is the issue? Example?
here I am attaching image which is explaning my issue regarding to workspace block, variables are come in main workspace through 'ans struct' and not like simplay array even though I folow same procedure as you mentioned.workspace.png
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.
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?
assign a return variable, Result=sim('model.slx');
hii i also faced this issue but the solution is
modeling>>model settings>>disable single simulation output

Sign in to comment.

hii i also faced this issue but the solution is
modeling>>model settings>>disable single simulation output

Categories

Products

Release

R2019b

Asked:

on 5 Dec 2019

Answered:

on 30 Sep 2021

Community Treasure Hunt

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

Start Hunting!