- As of R2020b/R2021a, the variables used in the variant conditions need to be from the same workspace. For example, Simulink does not support a variant block with condition ‘A==1 && B == 1’, where the variable ‘A’ is from the base workspace and the variable ‘B’ is from the mask workspace. As a resolution, please make sure that, for each of your variant conditions, the variant control variables belong to the same workspace.
- As of R2020b, the models cannot have duplicate variant control variables in the base workspace and a mask workspace. Otherwise, an error will show up. For example, if there is a variable ‘A’ in the base workspace that is being used in a variant control condition, then, there cannot be a variable ‘A’ in a mask workspace that is used in some other variant control condition. The vice-versa of this scenario also applies. To resolve this issue, please make sure that the variant control variables have unique names.
Variant errors when upgrading the MATLAB release
29 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
MathWorks Support Team
am 12 Jul. 2022
Bearbeitet: MathWorks Support Team
am 21 Okt. 2024
I have upgraded my Simulink models to the latest release. When I simulate the upgraded models, the following errors show up:
Variant control '<object name>' of variant block '<block name>' must be a condition expression or name of a Simulink.Variant object in the global scope workspace of the model. Ensure that the condition does not match the model name.
Error evaluating properties of Simulink.Variant object '<object name>' in workspace 'base' (used by block '<block name>')
Caused by: The variant condition <conditions> on the block '<block name> originate from different workspaces. This is not a supported workflow.
Akzeptierte Antwort
MathWorks Support Team
am 4 Okt. 2024
Bearbeitet: MathWorks Support Team
am 21 Okt. 2024
The causes of the errors and their corresponding resolutions are as follows:
These two issues have also been described in the following documentation:
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Manage Variant Modeling Components finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!