The following documentation page explain how to use the Single-Output Syntax for the sim Command:
This single-output syntax has been designed especially for calling SIM within PARFOR.
using that, you will call sim:
SimOut = sim('model', 'ReturnWorkspaceOutputs', 'on');
and everything will be stored in simOut. If logging both "logsout" for Simulink signals and and "simlog" for Simscape, you will be able to extract the data with a syntax like:
myVar1 = simOut.get('logsout'); myVar2 = simOut.get('simlog');
Best Answer