Problem changing Model Reference from GUI
9 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (0)
Ver también
Categorías
Más información sobre Component-Based Modeling en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!