MATLAB: How to generate code for a model so that the input ports can accept signals of any dimension in Simulink 6.6 (R2007a)

dynamicallyportssimulinksized

I would like to generate code for a model, so that the input ports in the root level of the model can accept data of any dimension. This would be very useful for Image Processing where the input image size is not fixed.

Best Answer

Building a model in which the input port dimensions are not explicitly specified is not supported in Simulink.
To work around this issue, you can create a C S-function which has input ports whose dimensions are dynamically sized.