Load the Lotka-Volterra model.
Get the configset object of the lotka model m1.
Display the list of species whose data are logged by default during the simulation.
ans =
SimBiology Species Array
Index: Compartment: Name: Value: Units:
1 unnamed x 1
2 unnamed y1 900
3 unnamed y2 900
4 unnamed z 0
Suppose you want to log just species y1 and y2 data. You can specify their names as a cell array of strings and set it to StatesToLog property.
Confirm the setting.
ans =
SimBiology Species Array
Index: Compartment: Name: Value: Units:
1 unnamed y1 900
2 unnamed y2 900
Alternatively, you can specify an array of species objects (instead of strings) to StatesToLog property.
Simulate and plot the results. Notice that simulation results of only y1 and y2 are plotted.
To reset to the default list, set StatesToLog to a string 'all', which means all species objects, all nonconstant compartment objects and all nonconstant parameter objects are logged by default. A nonconstant compartment or parameter means that its Constant property is set to false.
Simulate again. Notice all the species data are plotted.
Do not specify 'all' as a cell string such as {'all'}. If so, SimBiology interprets it as a species named all.