MATLAB: How to enable S-functions to work with multidimensional signals in Simulink 6.3 (R14SP3)

simulink

I am using different Simulink versions for different projects with different partners. In one of my projects (done in R2007b), I created a C-MEX S-function that makes use of "ssAllowSignalsWithMoreThan2D" to enable S-functions to work with multidimensional signals.
I want to reuse that code for another project with R14SP3. I want to know if there is a similar functionality for the older release. If not, is there any other way I can make use of multidimensional signals in R14SP3 S-functions?

Best Answer

The 'ssAllowSignalsWithMoreThan2D' functionality was introduced only in Simulink 6.6 (R2007a) and there is no similar functionality for previous releases. The following steps are a workaround for the issue of enabling S-functions to work with multidimensional signals in earlier versions:
1) Reduce the dimensionality of the signal to either 1D or 2D using the “Reshape” block.
2) Pass the signal through the S-function block (Note that your S-function may need to be modified to properly handle the reshaped signal).
3) At the output, reshape the signal to its original dimension using the “Reshape” block.