0

Given a process model in a C S-function (or a .mexw file), how can one determine the number of input/output ports together with their port widths programatically in Matlab (in a .m script file) without hardcoding them?

am304
  • 13,758
  • 2
  • 22
  • 40
remus
  • 2,635
  • 2
  • 21
  • 46

1 Answers1

1

You can use the same technique as in How can I get signal dimensions in Simulink model for the port widths. I believe the CompiledPortDimensions property should give you the number of I/O ports. You'll need to compile the model first though.

Community
  • 1
  • 1
am304
  • 13,758
  • 2
  • 22
  • 40