Export model to workspace - missing dose
2 ビュー (過去 30 日間)
古いコメントを表示
Hi!
I'm trying to export to the workspace the model attached using the "Export Model to Workspace" button. When I do that, and check the model exported in the workspace, I cannot find the repeated dose applied to the Central.Drug_Central species. I'm probably missing sometimes obvious but can't figure out what exactly.
Many thanks,
Jacopo
0 件のコメント
採用された回答
Jeremy Huard
2020 年 6 月 16 日
編集済み: Jeremy Huard
2020 年 6 月 16 日
Hi Jacopo,
doses are indeed included in the model.
You can retrieve them using the method getdose. getdose will return all doses in the model if you don't provide any dose name. If you do, it will return the dose with the name you specified. In your case, you could use the following command after exporting the model to the workspace:
dose = getdose(m1, 'dose_1')
Best regards,
Jérémy
2 件のコメント
Jeremy Huard
2020 年 6 月 16 日
Hi Jacopo,
doses do not show up in the variable editor because it's a hidden property. Alos, our developers pointed out to me that calling getdose is the recommended workflow to retrieve doses from a model object, rather than using this hidden property. I have edited my previous answer accordingly.
That being said, we understand this can be confusing and might have to rethink this design. Thanks for your feedback!
Best regards,
Jérémy
その他の回答 (1 件)
Sietse Braakman
2020 年 6 月 16 日
編集済み: Sietse Braakman
2020 年 6 月 16 日
Hi Jacopo,
When you export the model to the MATLAB workspace, by right clickin on the model in SimBiology and selecting 'Export Model to Workspace', you should get a variable m1 (default name) in the MATLAB workspace.
You can explore m1 on the MATLAB command line e.g.:
m1.Doses
m1.Species
m1.Compartments
etc. If you type m1. and hit the <tab> button on your keyboard (don't forget the period after m1!) you can see all the different methods (starting with a lower case letter, e.g. adddose) you can apply to m1 and the different objects within m1 such as Species, Compartments, Events, Parameters etc. However, Doses and Variants will now show up in the tab-complete because they, together with variants, are a hidden property of a model.
repeatdoses = sbioselect(m1, 'Type', 'repeatDose')
scheduledoses = sbioselect(m1,'Type','scheduleDose')
Let me know if that works for you.
Best,
Sietse
0 件のコメント
コミュニティ
その他の回答 SimBiology コミュニティ
参考
カテゴリ
Help Center および File Exchange で Biotech and Pharmaceutical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!