This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.


Plot simulation results in one figure


sbioplot(simDataObj, fcnHandleValue, xArgsValue, yArgsValue)



A SimData object or an array of SimData objects, containing data from simulation of a model.


Function handle.


Cell array with the names of the states.


Cell array with the names of the states.


sbioplot(simDataObj) plots each simulation run for simDataObj, a SimBiology® data object or array of data objects, in the same figure. The plot is a time plot of each state in simDataObj. The figure also shows a hierarchical display of all the runs in a tree, with the ability to choose which trajectories to display.

sbioplot(simDataObj, fcnHandleValue, xArgsValue, yArgsValue) plots each simulation run for the SimBiology data object, simDataObj, in the same figure. The plot is created by calling the function handle, fcnHandleValue, with input arguments simDataObj, xArgsValue, and yArgsValue.

xArgsValue and yArgsValue should be cell arrays with the names of the states. The function represented by the function handle should return an array of handles and names. The signature of the function is shown below.

function [handles, names] = functionName(simDataObj, xArgsValue, YArgsValue)

The output argument handles is a two-dimensional array of handles to the lines plotted by the function. Each column corresponds to a run and each row corresponds to the lines being plotted for a state. names is a one-dimensional cell array that contains the names to be displayed on the nodes which are children of a Run Node. The length of names should be equal to the number of rows in the handles array returned.


collapse all

This example shows how to plot data from an ensemble run.

Load the radiodecay model.


Configure the model to run with the stochastic solver. By default, there will be no interpolation.

cs = getconfigset(m1, 'active');
cs.SolverType = 'ssa';
cs.SolverOptions.LogDecimation = 100;

Run an ensemble simulation and view the results.

simDataObj = sbioensemblerun(m1, 10, 'linear');

Was this topic helpful?