Can a user defined C++ Simulink S-Function have input and output ports of different width?

1 view (last 30 days)
I'm writing a C++ S-Function for Simulink to connect Simulink to an electrical circuit simulator called Xyce.
To allow the user to specify a variable number of inputs and outputs, I'm using dynamicaly sized port widths. In my mdlInitializeSizes() function for example I have ssSetInputPortWidth(S, 0, DYNAMICALLY_SIZED). There is only 1 input port and 1 output port.
For this problem the input port width is independent of the output port width. However, it apears that Simulink enforces the input and output ports to be of the same width.
Is this a general rule for user defined C++ S Functions? Or is there a way to tell Simulink that my block input and output port widts can be different.
Thanks,

Answers (0)

Tags

Products


Release

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!