Variant Subsystems control by Model Workspace variables?
Ältere Kommentare anzeigen
Dear Community,
does there exist a way to use Model Workspace variables instead of Base Workspace variables for variant control?
I would like to avoid using callbacks for variant override.
I wonder why hierarchical symbol resolution ( http://blogs.mathworks.com/seth/2009/02/15/where-does-that-variable-come-from/ ) does not apply for variant control ...
Best regards,
Tilman
4 Kommentare
Christopher Slack
am 15 Mär. 2017
I would like to bump this question as I have just come across the same problem. In R2016b when trying to use Simulink.Variant in the model workspace variable the error is "...must be a condition expression or name of a Simulink.Variant object in the global scope workspace of the model."
Unfortunately, this just ends up with more bloat in the base workspace.
Francis Gagnon
am 26 Jan. 2018
I have exactly the same problem in R2017b. I would like to hide the Simulink.Variant variables from the global workspace...
Markus
am 19 Feb. 2021
I agree to the above. I would also prefer to have Simulink Variant objects in the model workspace.
Lee
am 25 Jan. 2022
Where is this limitation even mentioned in the documentation? I don't understand why variables referenced by variant control conditions would need to be present in a specific workspace. Furthermore, even after moving said variables into the base workspace, Simulink throws an error as it's still unable to evaluate logical expressions such as 'and' or '|' or 'not'
Antworten (2)
Mobashar Ahmad
am 28 Okt. 2019
0 Stimmen
Any updates on this? i would also like to use the Model Workspace to manage the variants control variables.
1 Kommentar
Markus
am 24 Jun. 2020
Same here. These make more sense in the model workspace anyway.
Any update from a staff member?
You can create a Simulink.Variant variable and put it inside a Data Dictionary, and then link this Data Dictionary to the model.
Kategorien
Mehr zu Component-Based Modeling finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!