This enhancement has been incorporated in Release 2009b (R2009b). For previous product releases, read below for any possible workarounds:
The SIM command simulates the model in the caller workspace that is any output from the model is sent to the caller workspace and not to the base workspace. To work around this you can use the EVALIN command in your MATLAB function or GUI callback where the SIM command is being called.
1. Download the attached files and execute the following code at MATLAB command prompt:
2. Click on the "simulate model" button in the GUI displayed. Verify that "simout" exists in the MATLAB base workspace by typing the following at MATLAB command prompt:
The "mini_gui.m" file uses the following code to import the data to MATLAB base workspace.
Also, note that the SIM command takes the values required for simulation from the base workspace. Refer to the Related Solution below for an example that demonstrates this.