getdata
Get simulation data from SimData object
Description
Examples
Load the G-protein model.
sbioloadproject('gprotein.sbproj');Simulate the model.
sdObj = sbiosimulate(m1); sbioplot(sdObj);

The plot shows all the states together. Plot each state separately on its own axes in a subplot.
First, extract the simulation data from the SimData object.
[time,data,names] = getdata(sdObj);
Calculate the number of rows and columns needed for the subplot.
sqrtnames = sqrt(numel(names)); nrows = round(sqrtnames); ncolumns = ceil(sqrtnames);
Create a subplot and plot each state on its own axes.
figure for(i = 1:numel(names)) subplot(nrows,ncolumns,i) plot(time,data(:,i)); title(names(i)); end

Input Arguments
Simulation data, specified as a SimData object or array of
SimData objects.
Simulation data format, specified as a character vector or string. Some formats require you to specify only one output argument. The valid formats follow.
'num'— This format returns simulation time points and simulation data in numeric arrays and the names of quantities and sensitivities as a cell array. This format is the default when you rungetdatawith multiple output arguments.'nummetadata'— This format returns a cell array of metadata structures instead of the names of quantities and sensitivities as the third output argument.'numqualnames'— This format returns qualified names in the third output argument to resolve ambiguities.
You must specify only one output argument for the following formats.
'simdata'— This format returns data in a newSimDataobject or an array ofSimDataobjects. This format is the default when you specify a single output argument.'struct'— This format returns a structure or structure array that contains both data and metadata.'ts'— This format returns data as a cell array.If
simdatais scalar, the cell array is an m-by-1 array, where each element is atimeseriesobject. m is the number of quantities and sensitivities logged during the simulation.If
simdatais not scalar, the cell array is k-by-1, where each element of the cell array is an m-by-1 cell array oftimeseriesobjects. k is the size ofsimdata, and m is the number of quantities or sensitivities in eachSimDataobject insimdata. In other words, the function returns an individual time series for each state or column and for eachSimDataobject insimdata.
'tslumped'— This format returns the data as a cell array oftimeseriesobjects, combining data from eachSimDataobject into a single time series.
Output Arguments
Simulation time points, returned as a numeric vector or cell array. If
simdata is scalar, t is an
n-by-1 vector, where n is the number of time
points. If simdata is an array of objects, t
is a k-by-1 cell array, where k is the size of
simdata.
Simulation data, returned as a numeric matrix or cell array. If simdata
is scalar, x is an n-by-m
matrix, where n is the number of time points and m
is the number of quantities and sensitivities logged during the simulation. If
simdata is an array of objects, x is a
k-by-1 cell array, where k is the size of
simdata.
Names of quantities and sensitivities logged during the simulation, returned as a cell array.
If simdata is scalar, names is an
m-by-1 cell array. If simdata is an array of
objects, names is a k-by-1 cell array, where
k is the size of simdata.
Simulation results, returned as a SimData object.
Version History
Introduced in R2008b
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Website auswählen
Wählen Sie eine Website aus, um übersetzte Inhalte (sofern verfügbar) sowie lokale Veranstaltungen und Angebote anzuzeigen. Auf der Grundlage Ihres Standorts empfehlen wir Ihnen die folgende Auswahl: .
Sie können auch eine Website aus der folgenden Liste auswählen:
So erhalten Sie die bestmögliche Leistung auf der Website
Wählen Sie für die bestmögliche Website-Leistung die Website für China (auf Chinesisch oder Englisch). Andere landesspezifische Websites von MathWorks sind für Besuche von Ihrem Standort aus nicht optimiert.
Amerika
- América Latina (Español)
- Canada (English)
- United States (English)
Europa
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)