Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Use integrated data to define rules in SimBiology Toolbox

조회 수: 2 (최근 30일)
Sebastian
Sebastian 2011년 11월 15일
마감: MATLAB Answer Bot 2021년 8월 20일
Hello,
I want to try the following thing, define a model, integrate some data and define a rule how to use the data to change parameters.
This is how I can currently access to data:
Mobj = sbiomodel('testmodel');
cell=addcompartment(Mobj,'cell',1,'ConstantCapacity',0,'UserData',data);
addrule(Mobj,'cell=myInterpolation(''cell'',time)', 'repeatedAssignment');
The function myInterpolation then opens a mat file where it accesses the right data, does the interpolation according to the actual time point and handles back the new cell volume.
It would be much easier to link the data to the model and access it, however I don't know how to call the linked data in the addrule function.
Thx!

답변 (2개)

Pramod Kumar
Pramod Kumar 2011년 11월 15일
Hi Sebastian,
There is no elegant way to store data on the model and be able to access it in a function that is used in a rule.
If the data is not too big you can hard code it in the rule function. to see an example look at insulindemo.m. This demo uses functions EndogenousGlucoseProduction and GlucoseAppearanceRate in repeated assignment rules. each of these functions have the data hard coded. They do an interpolation to compute the data at a given time point.

Sebastian
Sebastian 2011년 11월 15일
Thanks for the answer, the insuline demo will definitly help me to understand some more structure of the scripts. Unfortunately, I have to say that I plan to implement quite long time series and also a larger number of these. Additionally, I wanted flexibility as my data is organized in "modules" and I want to change one module while the other remains the same. Hardcoding will not work that good there - and I am not that keen on writing a script that writes me a script with hardcoded data. :)

이 질문은 마감되었습니다.

커뮤니티

더 많은 답변 보기:  SimBiology Community

제품

Community Treasure Hunt

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

Start Hunting!

Translated by