Documentation Center

  • Trial Software
  • Product Updates

getIndex

Class: SimBiology.export.Model

Get indices into ValueInfo and InitialValues properties

Syntax

indices = getIndex(model,name)
indices = getIndex(model,name,type)

Description

indices = getIndex(model,name) returns the indices of all ValueInfo objects in a SimBiology.export.Model object that have a QualifiedName or Name property that match the specified name input argument.

  • getIndex first tries to match the QualifiedName property. If there are matches, then getIndex returns their indices.

  • If there are no matches based on QualifiedName, then getIndex tries to match the Name property. If there are matches, then getIndex returns their indices.

  • If there are no matches based on QualifiedName or Name, then getIndex returns [].

indices = getIndex(model,name,type) returns indices for only the ValueInfo objects with a Type property that matches the type input argument.

Input Arguments

model

SimBiology.export.Model object.

name

String containing a name to match against the QualifiedName, then Name, properties of the ValueInfo objects in model.

type

String containing a name to match against the Type property of the ValueInfo objects in model.

Default: All types.

Output Arguments

indices

Vector of indices indicating which ValueInfo objects in a SimBiology.export.Model object match on the specified name and type.

Examples

expand all

Index Exported SimBiology Editable Values

Load a sample SimBiology model object, and export.

modelObj = sbmlimport('lotka');
em = export(modelObj);

Get the index of the editable value with name y1.

ix = getIndex(em,'y1')
ix =

     3

Display the type of value.

em.ValueInfo(ix).Type
ans =

species

The name y1 corresponds to an editable species.

See Also

| |

Was this topic helpful?