MATLAB: Log data to workspace while using ‘FastRestart’ option

MATLABsimulink

Hello Everyone,I am trying to use 'FastRestart' option for fast multiple simulations in SIMULINK using a for loop. The problem is that after every simulation, I need to log some data to workspace for some calculations. However, if I use 'FastRestart' or set any other simulation parameters using 'sim' command, data is not logged to workspace. Can anyone please tell me a work around this problem? Thanks in advance 🙂

Best Answer

The output that you want is located in the struct of the following command:
OUT=sim(mdl,'FastRestart','on','StopTime','1800')
Consider that the name of file in your To Workspace block is simout, then you can reach your logged data by typing
OUT.simout
Let me know the results.
Related Question