SimBiology getConfigSet does not recognise model object
1 回表示 (過去 30 日間)
古いコメントを表示
Alvaro Martinez Guimera
2019 年 6 月 28 日
コメント済み: Alvaro Martinez Guimera
2019 年 6 月 28 日
Hi,
I am trying to change the simulation settings of my Simbiology model through a Matlab script. I use the following code:
modelObj=sbioloadproject('RandomNetwork_5')
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,
Alvaro
0 件のコメント
採用された回答
Florian Augustin
2019 年 6 月 28 日
編集済み: Florian Augustin
2019 年 6 月 28 日
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:
s=sbioloadproject('RandomNetwork_5')
cs = getconfigset(s.m1, 'active');
Best,
-Florian
Edited answer:
Updated the code snippet after reading Jérémy's comment to account for sbioloadproject returning a structure.
2 件のコメント
その他の回答 (1 件)
Jeremy Huard
2019 年 6 月 28 日
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');
Best,
Jérémy
0 件のコメント
コミュニティ
その他の回答 SimBiology コミュニティ
参考
カテゴリ
Help Center および File Exchange で Extend Modeling Environment についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!