Why does the SIM command from Simulink 4.0 (R12) work incorrectly when you do not use left-hand arguments?
The following code will illustrate this problem:
vdp;set_param('vdp', 'SaveFinalState', 'On');a=simget('vdp');a=simset(a, 'FinalStateName','myname');a.FinalStateNamesim('vdp', 20, a);whos
The SIMSET command works and sets a new name instead of the default name "xFinal". However, after the simulation "xFinal" instead of "myname", is written in the workspace.
If you use left-hand arguments with the SIM command, it works correctly:
[t,x,y]=sim('vdp',20,myopts);
returns the changed name.
sim('vdp',20,myopts);
returns the default name.
Best Answer