This is machine translation

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

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

select (SimData)

Select data from SimData object


[t,x,names] = select(simDataObj, Query)
[Out] = select(simDataObj, Query, 'Format', 'FormatValue')


Output Arguments

tAn n-by-1 vector of time points.
xAn n-by-m data array. t and names label the rows and columns of x respectively.
namesAn m-by-1 cell array of names.
OutData returned in the format specified in 'FormatValue', shown in Input Arguments. Depending on the specified 'FormatValue', Out contains one of the following:
  • Structure array

  • SimData object

  • Time series object

  • Combined time series object from an array of SimData objects

Input Arguments

simDataObjSimData object array. Enter a variable name for a SimData object.
QueryA cell array of arguments consisting of some combination of property name/property value pairs and/or 'Where' clauses. For a more complete description of the query syntax, including 'Where' clauses and their supported condition types, see sbioselect. You can use any of the metadata fields available in the cells of the DataInfo property of a SimData object in a query. These include 'Type', 'Name', 'Units', 'Compartment' (species only), or 'Reaction' (parameter only).

Choose a format from the following table.

'num'Specifies the format that lets you return data in numeric arrays. This is the default when select is called with multiple output arguments.
'nummetadata'Specifies the format that lets you return a cell array of metadata structures in metadata instead of names. The elements of metadata label the columns of x.
'numqualnames'Specifies the format that lets you return qualified names in names to resolve ambiguities.
'struct'Specifies the format that lets you return a structure array holding both data and metadata. This is the default when you use a single output argument.
'simdata'Specifies the format that lets you return data in a new SimData object. This is the default format when select is called with zero or one output argument.
'ts'Specifies the format that lets you return data in time series objects, creating an individual time series for each state or column and SimData object in simDataObj.
'tslumped'Specifies the format that lets you return data in time series objects, combining data from each SimData object into a single time series.


[t,x,names] = select(simDataObj, Query) returns simulation time and state data from the SimData object (simDataObj) that matches the query argument Query.

In a SimData object simDataObj, the columns of the data matrix simDataObj.Data are labeled by the cell array of metadata structures given by simDataObj.DataInfo. The select method enables you to pick out columns of the data matrix based on their metadata labels. For example, to extract data for all parameters logged in a SimData object simDataObj, use the syntax [t, x, names] = select (simDataObj, {'Type', 'parameter'}]).

[Out] = select(simDataObj, Query, 'Format', 'FormatValue') returns the data in the specified format. Valid formats are listed in Input Arguments.


This example shows how to extract data of interest from your simulation data with the select method.

  1. The project file radiodecay.sbproj contains a model stored in a variable called m1. Load m1 into the MATLAB® workspace.

    sbioloadproject gprotein_norules m1
  2. Change the solver to use during the simulation and perform an ensemble run.

    csObj  = getconfigset(m1);
    set(csObj, 'SolverType', 'ssa');
    simDataObj = sbioensemblerun(m1, 10);
  3. Select all species data logged in the SimData array sdarray.

    [t x n] = select(simDataObj, {'Type','species'});
  4. Select data for the parameters with name 'Kd' and return the results in a new SimData object array.

     newsd = select(simDataObj, {'Type','parameter','name', 'Kd'});
  5. This selects all data from simDataObj with a name that matches the pattern 'G' and returns time series objects.

     ts = select(simDataObj, {'Where','Name','regexp','G'}, ...

Introduced in R2007b

Was this topic helpful?