Problem changing Model Reference from GUI
조회 수: 10 (최근 30일)
이전 댓글 표시
I launch a model from a GUI, and depending on what options are selected in the GUI, some model references should change. Currently, the model reference is set to have the following two variants:
I then add the following in a button push callback in the gui
CoolSys1 = Simulink.Variant('cs_Version==0');
CoolSys2 = Simulink.Variant('cs_Version==1');
cs_Version = get(handles.ShutterEnabled,'Value'));
I have also tried to add the Simulink.Variants to the handles of the GUI, to the model workspace and to the base workspace, but wherever I place them the model won't run and I get the following error:
Caused by:
Error using run_batchGUI (line 126)
The variant 'CoolSys1' of the variant block '.../Referenced Model (CoolSys)' must be the name of a Simulink.Variant object in the base workspace.
Error using run_batchGUI (line 126)
The variant 'CoolSys2' of the variant block '.../Referenced Model (CoolSys)' must be the name of a Simulink.Variant object in the base workspace.
Error while evaluating uicontrol Callback
I repeat, I get that error even when I DO have CoolSys1 and CoolSys2 in the model's and the base workpaces.
What can I do about this?
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Component-Based Modeling에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!