MATLAB: Build a output.dimension since inputport.data

outputsimulink

I have a s-function that it must to build the dimension of outputport with the data of inputport.
Example:
if the inputport receive 3 ( inputport(1).Data==3 ) then the dimension of outputport will be 8 x 3 ( outputport(1).Dimension=[ 8 3] ).
I don`t know if it`s posible????…
i don`t know how ???
Please helpme………….thank you

Best Answer

As long as the number of dimensions of your output do not change, and you are able to determine the largest size for each dimension, you should be able to do this using variable-size signals. The Level-2 MATLAB S-function demo described on this page actually does what you described.
Related Question