Is it possible to have a structure as an input and use its fields as constants in Simulink?
2 views (last 30 days)
Show older comments
Steven Horstink
on 20 May 2020
Commented: Steven Horstink
on 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 Comments
Accepted Answer
Srivardhan Gadila
on 27 May 2020
And the following code might help you:
par.amplitude = 10;
par.raise = 20;
parBusInfo = Simulink.Bus.createObject(par)
parBus = evalin('base',parBusInfo.busName)
More Answers (0)
See Also
Categories
Find more on Simulink Functions in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!