- 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
조회 수: 31 (최근 30일)
이전 댓글 표시
MathWorks Support Team
2022년 7월 12일
편집: MathWorks Support Team
2024년 10월 21일
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.
채택된 답변
MathWorks Support Team
2024년 10월 4일
편집: MathWorks Support Team
2024년 10월 21일
The causes of the errors and their corresponding resolutions are as follows:
These two issues have also been described in the following documentation:
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Manage Variant Modeling Components에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!