Can I create a variant that captures all current parameter, species and compartment values?
조회 수: 1 (최근 30일)
이전 댓글 표시
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
채택된 답변
Arthur Goldsipe
2018년 10월 1일
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.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Extend Modeling Environment에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!