- 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
34 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
MathWorks Support Team
le 12 Juil 2022
Modifié(e) : MathWorks Support Team
le 21 Oct 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.
Réponse acceptée
MathWorks Support Team
le 4 Oct 2024
Modifié(e) : MathWorks Support Team
le 21 Oct 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 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Manage Variant Modeling Components dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!