Export model to workspace - missing dose

5 次查看(过去 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

采纳的回答

Jeremy Huard
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 个评论
Jacopo Biasetti
Jacopo Biasetti 2020-6-16
Hi Jeremy,
Thanks for the answer. It, of course, works; but I still don't understand why the dose is not shown in the m1 tree, see attached image... am I missing something?
Thanks!
Jacopo
Jeremy Huard
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
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.
You can also use the sbioselect function.
repeatdoses = sbioselect(m1, 'Type', 'repeatDose')
scheduledoses = sbioselect(m1,'Type','scheduleDose')
Let me know if that works for you.
Best,
Sietse

社区

更多回答在  SimBiology Community

类别

Help CenterFile Exchange 中查找有关 Scan Parameter Ranges 的更多信息

产品


版本

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by