Ardeshir Goliaei in MATLAB Answers
上次活动时间: 2018-10-26

In my simbiology model, I can assign values to Species from a matlab file using the following syntax: m1.Species(5).InitialAmount = 10.0; The above will assign 10 to the fifth species. How do I assign values using index to parameters? My model has about 14 parameters and once I try to assign a value to the 6th parameter, using following syntax, I get the following error: m1.Parameters(6).Value = 0.01; Index exceeds array bounds. I appreciate your help.
Colin Phipps in MATLAB Answers
上次活动时间: 2016-10-19

Given a Simbioloogy 'model' I can access/get a specific compartment object if I know the numerical index, e.g. model.compartments(2) shows me the 2nd compartment. I can get/set properties from this indexing. Say this compartment is named 'turtle'. Can I get this compartment object from the Name, instead of by index? Something like model.compartments('turtle'), or model.compartments('Name'=='turtle'). although clearly these won't work.