When generating an s-function from a simulink block, can I select fields within an input structure to make them tunable parameters which show up within the s-functions mask?
6 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Jeremy Bauman
le 25 Fév 2022
Commenté : Jeremy Bauman
le 28 Fév 2022
I'm really just curious if there is a simple way to make tunable parameters from individual fields within structures that are passed into a simulink block when generating an s-function. What I'm looking for is something analgous to how you would normally select an input as a tunable parameter when generating an s-function, which then shows up in your s-functions simulink block mask. However, with passing workspace structures into the simulink block, it seems like you can select the structure as tunable and the generated code seems to provied a path to make the underlying fields tunable. However, I can't seem to find a simple way for this structure information to show up within my mask, that is, without having to do some code editing and recompiling, which I'm trying to avoid.
0 commentaires
Réponse acceptée
Benjamin Thompson
le 25 Fév 2022
It seems possible, according to this article in the Mathworks documentation, "Organize Data into Structures in Generated Code".
Your comment about passing individual fields of a structure to an S-Function as tunable parameters could be problematic, as I seem to remember that the "." operator was in the list of operators making an expression non-tunable. Right now I cannot lay my mouse on that article in the documentation. If you have success please post a followup comment.
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Simulink Coder dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!