Is it possible to have a structure as an input and use its fields as constants in Simulink?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Steven Horstink
am 20 Mai 2020
Kommentiert: Steven Horstink
am 5 Jun. 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 Kommentare
Akzeptierte Antwort
Srivardhan Gadila
am 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 Kommentar
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Simulink Functions finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!