Skip to Main Content Skip to Search
Product Documentation

Importing Signal Data in Simulink

Techniques for Importing Signal Data

To import data from a workspace, use one or more of the following techniques:

Guidelines for Specifying Time and Signal Values for Imported Data

Depending on your model development or testing goal, consider using the approach described in the following table.

Modeling GoalTime and Signal ValuesAdditional Notes

Import data representing a continuous plant

Specify a time vector and signal values extracted a continuous plan (for example, data that you acquire experimentally or from the results of a previous simulation).

Use any of the data formats listed in Input Data. Here are recommended formats for the following imported data sources:

  • Another simulation — Dataset

  • An equation — MATLAB time expression

  • Experimental data — MATLAB timeseries, data array, or structure

For details, see Specifying Time Data. For an example of using a structure to specify the time and signal values, see Importing Data to Model a Continuous Plant.

In the Inport block parameters dialog box, select Interpolate data.

To ensure that the Simulink variable time solver executes at the times that you specify in the imported data, set the Configuration Parameters >
Data Import/Export
>
Output options
parameter to Produce additional output.

Test a discrete algorithm

Use a structure, with an empty time vector.

Specify signal values, but no time vector. (One signal value is read at each time step, using the sample time of the source block.)

For an example of using a structure to specify the signal values, see Importing Data to Test a Discrete Algorithm.

In the Inport block parameters dialog box, clear Interpolate data.

Create an input test case

(An input test case is typically composed of steps and ramps, with discontinuities.)

Specify a time vector and signal values, but specify only the time steps at points where the shape of the output jumps.

For details about specifying a time vector, see Specifying Time Data.

Use any of the input data formats described in Input Data, except for MATLAB time expressions.

Select the Interpolate data parameter.

For the input, consider using a From Workspace, From File, or Signal Builder block, which trigger a zero-crossing at the discontinuities.

For examples of using a From Workspace block and a Signal Builder block, see Importing Data to Create an Input Test Case.

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS