MATLAB: What is the difference between a scalar N and a vector [1 N] when specifying Simulink signal size or dimension

simulink

What is the difference between a scalar N and a vector [1 N] when specifying Simulink signal size or dimension?

Best Answer

When specifying the size of a Simulink signal using a scalar N, a vector signal is created. On the other hand, when specifying the size of a Simulink signal with a vector [1 N] or [N 1], a matrix signal is created. Depending on the Simulink blocks, some blocks accept matrix signals, but some blocks do not.
When certain blocks throw an error due to a similar reason, you may consider using the "Reshape" block or the "Signal Specification" block to convert the signal into the correct dimension before connecting the signal into the block.
For more information on the "Signal Specification" block, refer to this link:
For more information on theĀ "Reshape" block, refer to this link: