MATLAB: How does the ‘Interpret vector parameters as 1-D’ option affect the display of signal values and the export to workspace in Simulink 7.4 (R2009b)

simulink

If I mark the option "Interpret vector parameters as 1-D" of a signal source block that outputs a vector (e.g. Constant block) the display block shows a column vector while the value exported by a To Workspace block has a number of columns equal to the dimension of the output signal. The display and output representations seem to be inconsistent.

Best Answer

This is expected behavior.
To better understand what is happening, consider the following example.
Three different cases are presented:
1. Constant source with "Interpret vector parameters as 1-D" option checked;
2. Constant source with "Interpret vector parameters as 1-D" option not checked and column input;
3. Constant source with "Interpret vector parameters as 1-D" option not checked and row input;
When the option "Interpret vector parameters as 1-D" is marked (as in case 1) the signal dimension is 4 as the length of the constant vector. The dimension is then represented by a single value and not an array as it happens in cases 2 and 3 where the option is not marked.
The display by default represent a 1-D vector with values displayed in a column.
The exported result of a one dimensional vector are characterized by a number of row equal to the timesteps and a number of columns equal to the length of your output vector. This is consistent with the default representation of exported time (tout) that is represented by a column vector.
If you disable this option the signal is represented by a matrix in case 2 with 4 rows and 1 column and vice versa in case 3. The display and the output are then completely defined by the dimensions of the input signal. You will notice that the output is then represented by a 3-D array. The first two index are associated to the matrix dimension while the third one is linked to the time vector.