| Using Simulink | ![]() |
The Data Import/Export pane allows you to import and export data to the MATLAB workspace. To display the pane, select Data Import/Export from the Select tree of the Configuration Parameters dialog box or select a configuration set (see Configuration Sets) in the Model Explorer and display the configuration's Data Import/Export subset.
Load from workspace
This group contains controls that enable you to specify options for importing data from the MATLAB workspace.
It includes the following controls.
Input. A MATLAB expression that specifies the data to be imported from the MATLAB workspace. See Importing Input Data from the MATLAB Workspace for information on how to use this field.
Initial state. A MATLAB expression that specifies the initial values of a model's states. See Importing and Exporting States for more information.
Save to workspace
This group contains controls that enable you to specify options for exporting data to the MATLAB workspace.
It includes the following controls.
Time. Name of the MATLAB variable to be used to store simulation time data to be exported during simulation.
States. Specifies the name of a MATLAB variable to be used to store state data exported during a simulation. See Importing and Exporting States for more information.
Ouput. Name of the MATLAB variable to be used to store signal data exported during this simulation. See Exporting Output Data to the MATLAB Workspace for more information.
Final states. Specifies the name of a MATLAB variable to be used to store the values of this model's states at the end of a simulation. See Importing and Exporting States for more information.
Signal logging. Globally enables or disables signal logging for this model. The adjacent edit field specifies the name of the signal logging object used to record logged signal data in the MATLAB workspace. See Logging Signals for more information.
Save options
This group contains controls that allow you to specify options for saving (and reloading) data from the MATLAB workspace.
It includes the following controls.
Limit data points to last. Limits the number of data points exported to the MATLAB workspace to N, the number specified in the adjacent edit field. At the end of the simulation, the MATLAB workspace contains the last N points generated by the simulation.
Decimation. If specified, Simulink outputs only every N points, where N is the specified decimation factor.
Format. Specifies the format of state and output data saved to or loaded from the MATLAB workspace. The options are
The format of the data is a structure that has two fields: a time field and a signals field. The time field contains a vector of simulation times. The signals field contains a substructure for each model input port (for imported data) or output port (for exported data). Each port substructure contains signal data for the corresponding port.
The format of the data is a structure that contains substructures for each port. Each port substructure contains signal data for the corresponding port.
See Importing and Exporting Simulation Data for more information on these formats.
Output options. Options for generating additional output signal data.
| Note These options appear only if the model specifies a variable-step solver (see The Solver Pane). |
Output data between as well as at simulation times steps. Selecting this option causes the Refine factor edit field to appear below this control (see Refine factor). Use this field to specify the number of points to generate between simulation time steps. For more information, see Refining Output.
Produce additional output at specified times. Selecting this option causes the Output times field to appear. Use this field to specify the simulation times at which Simulink should generate additional output.
Produce output only at specified times. Selecting this option causes the Output times field to appear. Use this field to specify the simulation times at which Simulink should generate output.
Refine factor. This field appears when you select Refine output as the value of Output options. It specifies how many points to generate between time steps. For example, a refine factor of 2 provides output midway between the time steps, as well as at the steps. The default refine factor is 1. For more information, see Refining Output.
| Note Simulink ignores this option for discrete models. This is because the value of data between time steps is undefined for discrete models. |
Output times. This field appears when you select Produce additional output or Produce specified output as the value of Output options. Use this field to specify times at which Simulink should generate output in addition to or instead of at the simulation steps taken by the solver used to simulate the model.
| The Solver Pane | The Optimization Pane | ![]() |
© 1994-2005 The MathWorks, Inc.