Simulink: Mask parameter fails to bind to block port
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Lucas Ritzdorf
il 15 Apr 2024
Commentato: Lucas Ritzdorf
il 17 Apr 2024
I'm currently working with a MATLAB Function block inside of Simulink, and I'd like to expose one of the function's arguments as a parameter in the Simulink UI. A mask seems to be the usual way of doing this, but upon adding a mask, it doesn't "bind" to the underlying block's port, as I would have expected.
Is this normal? If not, how might I go about troubleshooting this? If so, how can I prevent later users from connecting normal Simulink signals to the exposed port?
For reference, here are my mask parameters, as well as the underlying block (with the masked port exposed):
2 Commenti
Fangjun Jiang
il 15 Apr 2024
I am not following. "expose one of the function's arguments", what argument? what do you mean by "expose"?
Risposta accettata
Fangjun Jiang
il 16 Apr 2024
- It is more involved for this task. I hope the attached model (in R2022b) make it easier.
- In your model, the two inports are called input arguments, the two outports are called output arguments.
- You need to make "num_outputs" as a "parameter data", not "input data".
- You need to make "output" variable size and specify the max value as 24.
- Make a mask and pass down the value for "num_outputs"
- Run simulation and you will see 5 elements are non-zoro. Double click the masked MATLAB Function block, change the value from 5 to 3 to see the output display.
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Author Block Masks in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!