Is it possible to have a structure as an input and use its fields as constants in Simulink?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Steven Horstink
le 20 Mai 2020
Commenté : Steven Horstink
le 5 Juin 2020
Suppose I define in a script the structure
par.amplitude = 10;
par.raise = 20;
and then run the Simulink model as in the picture below. The model below gives an error, obviously: the question is, how should I build such a model such that it works as expected? Is this even possible?
0 commentaires
Réponse acceptée
Srivardhan Gadila
le 27 Mai 2020
And the following code might help you:
par.amplitude = 10;
par.raise = 20;
parBusInfo = Simulink.Bus.createObject(par)
parBus = evalin('base',parBusInfo.busName)
1 commentaire
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Simulink Functions 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!