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 Community
참고 항목
카테고리
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!