How to access architecture parameter from inside simulink model

4 次查看(过去 30 天)
I have a system composer architecture made up of subsystems with some stereotypes assigned to them allowing me to define specific parameters.
I've converted those subsystems into behaviours so that I can add simulink and stateflow logic. Now I want to access the parameters (defined by the stereotype) in the architecture of the appropriate subsystem. I want those parameters to be accesible from inside the behaviour.
For example tp define the resitance of motor windings in the model architecture as a parameter, and then the behaviour simulates the motor using the value from that parameter. Can't seem to find a way to do it.
I've been trying to use the getParameter function along with the gcb function however I'm not making much progress. The gcb function returns a string and I can't find a way to convert that to an architecture object with which to use the getParameter function with
https://uk.mathworks.com/help/simulink/slref/gcb.html
Would love some help

采纳的回答

Josh Kahn
Josh Kahn 2022-10-27
  1 个评论
Paul
Paul 2022-10-28
Hi Josh,
Yes that looks very much like what I need thank you!
Its very difficult to find information about this when it seems like a fundamental functionality. Its confusing because the prototypes are shown as a major feature, and the examples show things like mass and other properties defined there, so it feels intuitive that the behaviour should be able to use those properties, but then the examples don't. So its a bit counter intuitive.
That link is a good starting point though thank you!
Paul

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Multicore Processor Targets 的更多信息

产品


版本

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by