Filter löschen
Filter löschen

How can I add port label to my Simulink block within C MEX?

4 Ansichten (letzte 30 Tage)
Daniel
Daniel am 14 Dez. 2012
Dear All,
I'm looking for a solution how can I add a port label to my Simulink block within my C MEX S function.
The number of the outputs depends on a masked parameter, so I can't define it at the mask statically. I'd like to have similar guise: http://www.mathworks.com/help/simulink/slref/port_label.html
I've checked this one, but It's not working: http://www.mathworks.com/matlabcentral/answers/31360
Kind regards,
Daniel

Akzeptierte Antwort

Guy Rouleau
Guy Rouleau am 14 Dez. 2012
If the port label depends on a mask parameter, it should be possible to do it in the mask, not in the S-Function.
I do not have an example to do exactly what you are looking for, but the Mask Drawing command has access to mask parameters So it should be possible to write mask drawing commands to achieve what you are looking for.
In R2012b, we have added a new set of examples to show typical things done in masks:
We also have a series of posts on masking here:
Those two links should give you some inspiration to implement what you are looking for.
  1 Kommentar
Daniel
Daniel am 15 Dez. 2012
Thank you! Based on your answer I've written a small matlab code into the mask, so I could parse the parameter string and set up the labels correctly.
Kind regards,
Daniel

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Author Block Masks finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by