Documentation Center

  • Trials
  • Product Updates


Specify species, compartment, or parameter data recorded


The StatesToLog property specifies the species, compartment, or parameter data to log during a simulation. This is the data returned in x during execution of [t,x] = sbiosimulate(modelObj). By default, all species, nonconstant compartments, and nonconstant parameters are logged.


Applies toObject: RuntimeOptions
Data typeObject or vector of objects
Data valuesSpecies objects, compartment objects, or parameter objects. Default is all, which means all species objects, all compartment objects whose ConstantCapacity = false, and all parameter objects whose ConstantValue = false.


This example shows how to assign species to StatesToLog.

  1. Create a model object by importing the file oscillator.xml.

    modelObj  = sbmlimport('oscillator');
  2. Retrieve the first and second species in modelObj.

    speciesObj1 = modelObj.Species(1);
    speciesObj2 = modelObj.Species(2);
  3. Retrieve the configsetObj of modelObj.

    configsetObj = getconfigset(modelObj);
  4. Set the StatesToLog to record three species: two using the retrieved species objects and one using indexing and view the species in StatesToLog.

    set (configsetObj.RuntimeOptions, 'StatesToLog', [speciesObj1, speciesObj2, modelObj.Species(3)]);
    get(configsetObj.RuntimeOptions, 'StatesToLog')
  5. Set the StatesToLog property back to the default setting of all.

    set (configsetObj.RuntimeOptions, 'StatesToLog', 'all');
Was this topic helpful?