| Contents | Index |
| On this page… |
|---|
Techniques for Importing Signal Data Guidelines for Specifying Time and Signal Values for Imported Data |
To import data from a workspace, use one or more of the following techniques:
From Workspace or From File blocks (for details, see Importing Data to Create an Input Test Case)
A Signal Builder block (for details, see Importing Data to Create an Input Test Case)
A root-level Inport or Trigger block (for details, see Importing Data to Root-Level Input Ports)
A Simulink.SimulationData.Signal object (for details, see Importing Signal Logging Data)
Depending on your model development or testing goal, consider using the approach described in the following table.
| Modeling Goal | Time and Signal Values | Additional 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:
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 > |
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. |
![]() | Accessing Signal Logging Data | Importing Data to Model a Continuous Plant | ![]() |

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 |