Info
この質問は閉じられています。 編集または回答するには再度開いてください。
Passing Strings to Reference Model Parameters
1 回表示 (過去 30 日間)
古いコメントを表示
I have a top level model 'X' that references an actuator model 'Y' 4 times. Model Y takes its parameter input values from a structure of SimParams that have the structure Sys.Act.S2E.aaa.bbb. I cannot change the first 3 levels of the structure (Sys.Act.S2E). aaa represents which of the 4 actuators it is (c1p, c1y, c2p, or c2y) and bbb represents the parameter for that actuator. (i.e. Sys.Act.S2E.c1p.eff)
I am trying to find a way to pass the actuator identifier to the parameter block to get the value from the Sys structure. Ideally, I would put something like "Sys.Act.S2E.(x).eff" into the blocks parameter input. Then in the top level model I could pass "c1p" as "x" to get Sys.Act.S2E.c1p.eff.
I parameterized the reference model block so it would take the model argument x, but it seems that only integers can be passed as parameters and not strings like "c1p." Is there any other way to pass a string to the parameter value box in a reference model?
1 件のコメント
Rakesh Chavan
2016 年 3 月 17 日
Hi,
Have you tried looking at variant subsystems? As far as I understand for your use case, you have certain parameters which are governing which of the actuators to use and based on that setting different values. A variant system may help in achieving this task.
The doc link is given below: http://www.mathworks.com/help/releases/R2015b/simulink/slref/variantsubsystem.html
Hope this helps
regards
Rakesh
回答 (0 件)
この質問は閉じられています。
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!