Main Content

reorder (model, compartment, kinetic law)

Reorder component lists

Syntax

modelObj = reorder(Obj,NewOrder)

Input Arguments

ObjModel, compartment, or kinetic law object.
NewOrder

Object vector in the new order. If Obj is a model object, NewOrder can be an array of compartment, event, parameter, reaction, rule, variant, or dose objects. If Obj is a compartment object, NewOrder must be an array of species objects. If Obj is a kinetic law object, NewOrder must be an array of parameter objects.

Warning

As of 2017b, reordering rules has no effect on simulation results because the rules are evaluated as a unified system of constraints. For details, see Evaluation Order of Rules.

Description

modelObj = reorder(Obj,NewOrder) reorders the component vector modelObj to be in the order specified.

Use this method to reorder any of the component vectors, such as compartments, events, parameters, rules, species, doses, and variants. When reordered, the vector of components must contain the same objects as the original list of objects, though they can be in a different order.

Examples

collapse all

Import a model.

modelObj = sbmlimport('lotka');

Display reactions in the model.

modelObj.Reactions
ans = 
   SimBiology Reaction Array

   Index:    Reaction:         
   1         x + y1 -> 2 y1 + x
   2         y1 + y2 -> 2 y2   
   3         y2 -> z           

Reverse the order of reactions in the model.

reorder(modelObj,modelObj.Reactions([3 2 1]));

Display the new order of reactions.

modelObj.Reactions
ans = 
   SimBiology Reaction Array

   Index:    Reaction:         
   1         y2 -> z           
   2         y1 + y2 -> 2 y2   
   3         x + y1 -> 2 y1 + x

Version History

Introduced in R2007b