Can I set simbiology repeat assignment rule state to active or inactive using variants?
1 次查看(过去 30 天)
显示 更早的评论
Using the paradigm similar to that in Dr. Goldspie's insulindemo example, I'm using two rules to set a variable parameter. Let's call the parameter "state_used". In the model, an ODE is used to calculate the species "ODE_state". And I have a function of time calculated to generate "forced_state". One rule sets "state_used" to "ODE_state". The other sets "state_used" to "forced_state". By setting one (and only one) or the other, I can have the model generate the state values, or I can force the state values. For all calculations, the model uses "state_used".
Can I have a variant set a repeat assignment rule to active or inactive?
Or, must I use a MATLAB script to "set" the .Active property to 0 or 1?
An alternate approach would be to have a single assignment rule "ODE_switch" such that
state_used = ODE_switch*ODE_state + (1-ODE_switch)*forced_state
in which case the ODE_switch parameter could be set via variants.
Thanks.
0 个评论
采纳的回答
Arthur Goldsipe
2018-3-30
You cannot currently use variants to set the Active property of a Rule (or any other object). I agree this is an obvious extension to variants, and we've heard about similar use cases before. Until SimBiology gets such functionality, I recommend either of the alternatives you've already mentioned: setting Active via a script or recasting the rule into something that can be controlled via a variant.
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Scan Parameter Ranges 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!