Main Content

move

Move SimBiology compartment object to new owner

Since R2020b

Description

example

compObj = move(compObj,newOwner) moves a SimBiology® compartment object compObj to a new owner newOwner.

Examples

collapse all

Create a model with two compartments.

m = sbiomodel('cell');
c1 = addcompartment(m,'c1');
c2 = addcompartment(m,'c2');
p = addparameter(m,'k1',5);
r = addreaction(m,'c1.A + c1.B -> c2.B');
k = addkineticlaw(r,'MassAction');
k.ParameterVariableNames = 'k1';

Move compartment c1 to c2.

c1 = move(c1,c2);

The owner of c1 is now c2.

c1.Owner
ans = 
   SimBiology Compartment - c2 

   Compartment Components:
     Value:             1
     Units:             
     Compartments:      1
     Constant:          true
     Owner:             
     Species:           1

Input Arguments

collapse all

SimBiology compartment, specified as a compartment object.

New owner object, specified as a model object or compartment object.

Version History

Introduced in R2020b