Single simulation output
Option to return simulation results as single
                Simulink.SimulationOutput object
Model Configuration Pane: Data Import/Export
Description
The Single simulation output parameter provides the option to return a
            single Simulink.SimulationOutput object that
            contains all simulation results.  Using the single-output format makes processing
            results from several simulations easier and provides better support for parallel and
            batch simulations. When you enable the Single simulation output
            parameter, you can use the same code to process results, no matter how you run the
            simulation.
Simulating a model creates one or more Simulink.SimulationOutput
            objects in any of these situations, even when you disable Single simulation
                output:
- You simulate the model programmatically using one or more - Simulink.SimulationInputobjects.- You can configure simulations using - SimulationInputobjects when you run simulations using the- sim,- parsim, and- batchsimfunctions or using the- Simulationobject.
- You simulate the model using a - simfunction syntax that returns results as a single simulation output.- For more information, see - sim.
- You run a set of simulations using the Multiple Simulations panel. 
Settings
on (default) | off- on
- All simulation data logged to the workspace is returned as a single - Simulink.SimulationOutputobject. By default, the name of the variable that stores the- SimulationOutputobject is- out. To use a different variable name, specify a valid MATLAB® variable name in the text box.- When you simulate a model programmatically, the name you specify in the text box does not determine the name of the variable that stores the - SimulationOutputobject. The- SimulationOutputobject is stored in the variable to which you assign the return argument. For example, for this simulation, the- SimulationOutputobject variable name is- simout.- simout = sim(simin); 
- off
- Logged simulation results are returned as one or more variables, depending on the logging options configured in the model and how you run the simulation. - When you simulate the model using the model name syntax of the - simfunction without specifying any other arguments, the simulation returns only the time vector. To have the simulation return complete results, enable the Single simulation output parameter for the simulation by specifying the- ReturnWorkspaceOutputsname-value argument.- out = sim(mdl,ReturnWorkspaceOutputs="on");- Syntaxes of the - simfunction that return multiple arguments are not recommended. For more information, see Syntaxes that return multiple output arguments are not recommended.
Examples
Tips
- When you log data using the To File block, the data logs to the specified file and does not appear in the single - Simulink.SimulationOutputobject.
- When you select Log data to file, the data that logs to the file is not included in the single - Simulink.SimulationOutputobject.
- Enabling fast restart enables the Single simulation output parameter. 
- Use the - whofunction for the- Simulink.SimulationOutputobject to view a list of the variables in the object.
- To use the Logging intervals parameter, you must select Single simulation output. 
Programmatic Use
| Parameter: ReturnWorkspaceOutputs | 
| Value: "on"|"off" | 
| Default: "on" | 
| Parameter: ReturnWorkspaceOutputsName | 
| Type: string | character vector | 
| Value: valid MATLAB variable name | 
| Default: "out" | 
Version History
Introduced in R2009b



