Can I create a variant that captures all current parameter, species and compartment values?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Jim Bosley
am 28 Sep. 2018
Kommentiert: Jim Bosley
am 2 Okt. 2018
So I'd like to be able to do something like this:
sbr = sbioroot; % Get the root object
lastn = length(sbr.models); % Get index of the last model object (presumably the one I'm using)
ml = sbr.models(lastn); % Get a handle for the model in use;
varobj = sbiovariant('Current'); % add a variant to that model
varobj = addcontent(varobj,allcurrentcontent(m1));
or perhaps instead of "all current content" I could use more granular commands, as in the desktop. In interactive mode, I can "add all species", "add all compartments" and "add all parameters" to a variant.
So perhaps
varobj = addcontent(varobj,m1.species);
varobj = addcontent(varobj,m1.parameters);
varobj = addcontent(varobj,m1.compartments);
Ideally, the sbiovariant command would allow a flag. All, Species, Compartments, and Parameters. So
varobj = sbiovariant('Current','All'); % adds a variant containing all numbers to the current model
Or is there already something like this that I'm missing?
Thanks!
0 Kommentare
Akzeptierte Antwort
Arthur Goldsipe
am 1 Okt. 2018
You're not overlooking anything. We just need to make variants easier to use. Right now, I would probably do this by making a helper function with a "for loop" to add each item to the variant.
Also, one note. There are two ways to make a variant in SimBiology. When you call "sbiovariant" you are making a "standalone" variant. You can also call "addvariant" to create a variant that is stored on your model. One reason to make a standalone variant is if you want to use it with multiple related models.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Extend Modeling Environment finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!