sbioplot

Plot simulation results in one figure

Syntax

sbioplot(simDataObj)
sbioplot(simDataObj, fcnHandleValue, xArgsValue, yArgsValue)

Arguments

simDataObj

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

fcnHandleValue

Function handle.

xArgsValue

Cell array with the names of the states.

yArgsValue

Cell array with the names of the states.

Description

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.

Examples

expand all

Plot Data from an Ensemble Run

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

Load the radiodecay model.

sbioloadproject('radiodecay.sbproj','m1');

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');
sbioplot(simDataObj);

Was this topic helpful?