Borrar filtros
Borrar filtros

SimBiology getConfigSet does not recognise model object

1 visualización (últimos 30 días)
I am trying to change the simulation settings of my Simbiology model through a Matlab script. I use the following code:
cs = getConfigSet(modelObj,'active');
However I get the following error:
Error using getConfigSet (line 10)
The first input to get_param must be of type 'double', 'char' or 'cell'.
I have no idea of what might be going wrong here and would appreaciate some help. I attach the .sbproj file in case it is of any use.
Many thanks,

Respuesta aceptada

Florian Augustin
Florian Augustin el 28 de Jun. de 2019
Editada: Florian Augustin el 28 de Jun. de 2019
Hi Alvaro,
I think you are seeing an unfortunate naming collision. SimBiology's method is getconfigset (all lower-case). The method getConfigSet is a method in Simulink. The following should work:
cs = getconfigset(s.m1, 'active');
Edited answer:
Updated the code snippet after reading Jérémy's comment to account for sbioloadproject returning a structure.
  2 comentarios
Jeremy Huard
Jeremy Huard el 28 de Jun. de 2019
+1, good catch!
Alvaro Martinez Guimera
Alvaro Martinez Guimera el 28 de Jun. de 2019
Aha! These were exactly the issues. Thank you very much Jeremy and Florian!

Iniciar sesión para comentar.

Más respuestas (1)

Jeremy Huard
Jeremy Huard el 28 de Jun. de 2019
Hi Alvaro,
sbioloadproject will return a struct that contains your model(s).
This should work:
s = sbioloadproject('RandomNetwork_5');
modelObj = s.m1;
cs = getConfigSet(modelObj,'active');

Comunidades de usuarios

Más respuestas en  SimBiology Community


Más información sobre Perform Sensitivity Analysis en Help Center y File Exchange.




Community Treasure Hunt

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

Start Hunting!

Translated by