Import Data Arrays

Data Array Format

This import format consists of a real (noncomplex) matrix of data type double. The first column of the matrix must be a vector of times in ascending order. The remaining columns specify input values. In particular, each column represents the input for a different Inport or Trigger block signal (in sequential order) and each row is the input value for the corresponding time point. For a Trigger block, the signal driving the trigger port must be the last data item.

The total number of columns of the input matrix must equal n + 1, where n is the total number of signals entering the model's input ports.

Specify the Input Expression

The default input expression for a model is [t,u] and the default input format is Array. So if you define t and u in the MATLAB® workspace, you need only select the Input option to input data from the model workspace. For example, suppose that a model has two input ports, In1 that accepts two signals, and In2 that accepts one signal. Also, suppose that the MATLAB workspace defines t and u as follows:

N = 10;
Ts = 0.1
t = ((0:N)* Ts)';
u = [sin(t), cos(t), 4*cos(t)];

When the simulation runs, the signals sin(t) and cos(t) will be assigned to In1 and the signal 4*cos(t) will be assigned to In2.

    Note   The array input format allows you to load only real (noncomplex) scalar or vector data of type double. Use the structure format to input complex data, matrix (2-D) data, and/or data types other than double.

Was this topic helpful?