Problem changing Model Reference from GUI

9 visualizaciones (últimos 30 días)
Fabian Jonsson
Fabian Jonsson el 9 de Mzo. de 2015
Editada: Fabian Jonsson el 11 de Mzo. de 2015
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:
CoolSys1 name 1
CoolSys2 name 2
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?

Respuestas (0)

Categorías

Más información sobre Component-Based Modeling en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by