Hi,
I have written an Level-2 S-function which creates a 2×1 vector from a 4×1 vector, that it, taking out the first 2 elements.
The function “Output()” is:
function Output(block)block.OutputPort(1).Data = block.InputPort(1).Data(1:2); Error: Attempt to assign a matrix of dimentions [2x1] to a matrix of dimensions [4x1].
So I added the following code to the function “Setup()”:
function Setup(block) block.OutputPort(1).Dimensions = [2,1];
This time the error is:
Invalid dimentsion has been specified for input port 1 of …
Now I am helpless with this problem. Who can help me with this problem?
Thanks Senmeis
Best Answer