copyobj
Copy SimBiology object and its children
Syntax
copiedObj
= copyobj(Obj
, parentObj
)
copiedObj
= copyobj(modelObj
)
Arguments
| Compartment, configuration set, event, kinetic law, model, parameter, reaction, rule,
species, RepeatDose, ScheduleDose, variant, or observable object. Note Abstract kinetic law objects cannot be copied using
| ||||||||||||||
|
| ||||||||||||||
| Model object to be copied. | ||||||||||||||
| Output returned by the copyobj method with the parent set as
specified in input argument
( ). |
Description
makes a copy of a SimBiology® object (copiedObj
= copyobj(Obj
, parentObj
)Obj
) and returns a pointer to the copy
(copiedObj
). In the copied object
(copiedObj
), this method assigns a value
(parentObj
) to the property Parent
.
makes a copy of a model object (copiedObj
= copyobj(modelObj
)
) and
returns the copy (modelObj
). In the copied model
object (copiedObj
copiedObj
), this method assigns the root object to the
property Parent
.
Note
When the copyobj
method copies a model, it resets the StatesToLog
property to the default value. Similarly, the Inputs
and Outputs
properties are not copied but rather left
empty. Thus, when you simulate a copied model you see results for the default states, unless you
manually update these properties.
Examples
Create a reaction object separate from a model object, and then add it to a model.
Create a model object and add a reaction object.
modelObj1 = sbiomodel('cell'); reactionObj = addreaction(modelObj1, 'a -> b');
Create a copy of the
reaction object
and assign it to anothermodel object
.modelObj2 = sbiomodel('cell2'); reactionObjCopy = copyobj(reactionObj, modelObj2); modelObj2.Reactions
SimBiology Reaction Array Index: Reaction: 1 a -> b
Version History
Introduced in R2006a