Export model to workspace - missing dose

2 visualizaciones (últimos 30 días)
Jacopo Biasetti
Jacopo Biasetti el 16 de Jun. de 2020
Comentada: Jeremy Huard el 16 de Jun. de 2020
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,

Respuesta aceptada

Jeremy Huard
Jeremy Huard el 16 de Jun. de 2020
Editada: Jeremy Huard el 16 de Jun. de 2020
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,
  2 comentarios
Jeremy Huard
Jeremy Huard el 16 de Jun. de 2020
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,

Iniciar sesión para comentar.

Más respuestas (1)

Sietse Braakman
Sietse Braakman el 16 de Jun. de 2020
Editada: Sietse Braakman el 16 de Jun. de 2020
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.:
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.

Comunidades de usuarios

Más respuestas en  SimBiology Community


Más información sobre Scan Parameter Ranges 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