Variant Subsystem variant control condition defined by previous subsystem output
15 views (last 30 days)
Show older comments
How can I use a previous block output as the the control variable ? (connecting the constant value output to the variant subsystem is useless because the conditions variables are supposed to be determined by base-workspace variables in the case of variant subsystems)
Error evaluating properties of Simulink.Variant object 'a' in workspace 'base' (used by block '....../Variant Subsystem')
Caused by: Variant condition 'ind==1' should return a logical value Attempt to reference field of non-structure array.
http://www.mathworks.com/matlabcentral/answers/69974-writing-value-to-workspace-and-taking-that-value-from-workspace-to-be-used-in-another-model-part So I understand variant subsystems aren't helpful for parameters that aren't constant during simulation, but what about parameters that are determined only at the beginning of the simulation?
http://stackoverflow.com/questions/17005899/how-to-export-simulink-data-to-workspace-during-simulation - messed with this
by the way: I tried using Block priorites+ To workspace block, But I was limited by the condition variable type int8 (Timeseries form, couldn't change it), so that ind.Data==int8(1) didn't work as a condition....
0 Comments
Accepted Answer
Guy Rouleau
on 19 Aug 2013
This is not what variant subsystems have been designed for. Use a if-else construct, a Switch, or other options like the ones I described here:
More Answers (0)
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!