Main Content

MultisimDatastore

Create datastore for post-processing large-scale simulation results

Since R2025a

Description

The simulink.multisim.MultisimDatastore object is a custom object that allows you to post-process your simulation results in parallel. The simulink.multisim.MultisimDatastore iterates over multiple complete simulation results. You can use simulink.multisim.MultisimDatastore object only with simulink.multisim.DesignStudy simulations.

Creation

Description

ds = multisimDatastore(location) creates a MultisimDatstore object from the collection of data specified by location. After creating ds, you can read and post-process the simulation results.

ds = multisimDatastore(multisimFuture) creates a MultisimDatstore object from the simulation outputs that are returned as a simulink.multisim.Future object.

ds = multisimDatastore(job) creates a MultisimDatstore object from the Simulink.Simulation.Job object that is returned with batchsim simulations.

example

Input Arguments

expand all

File path to the location in which to store simulation data, specified as a string or a character vector. The file path can be any location supported by MATLAB datastores, including an IRI path pointing to a remote location. However, when you use a simulationEnsembleDatastore to manage remote data, you cannot use writeToLastMemberRead to add data to the ensemble datastore. For more information about working with remote data in MATLAB, see Work with Remote Data

Example: "C:\dir\data\simresults"

Simulation results to create a datastore from, specified as a simulink.multisim.Future object.

batchsim simulation results to create a datastore from, specified as a simulink.multisim.Job object. You can use simulink.multisim.MultisimDatastore object only with simulink.multisim.DesignStudy simulations.

Output Arguments

expand all

Datastore for a collection of data, returned as a simulink.mulitsim.MultisimDatastore object.

For each of these datastore types, the Files property is a cell array of character vectors. Each character vector is an absolute path to a file resolved by the location argument.

Properties

expand all

Number of simulations, specified as a double.

Object Functions

combineCombine data from multiple datastores
hasdataDetermine whether data is available to read
readRead chunk of data in simulink.multisim.MultisimDatasore object
readallRead all data in datastore
resetReset datastore to initial position
previewReturn subset of data from datastore
progressReturn percentage of data read from datastore
numpartitionsNumber of datastore partitions
transformTransform datastore

Examples

collapse all

Create a simulink.multisim.MultisimDatastore object and use it to post-process simulation results. This example uses the CSTR model and runs a parameter sweep.

Create a DesignStudy object for simulation.

FeedTempSweep = 200:5:400;
range = simulink.multisim.Variable("FeedTemp0",FeedTempSweep);
exhaustive = simulink.multisim.Exhaustive(range);
study = simulink.multisim.DesignStudy('CSTR', exhaustive);

Run simulations in parallel and store the outputs on the cluster. The simulation results are returned as a simulink.multisim.Future object, future

location = 'cluster-storage';
future = parsim(study, OutputLocation=location)

Create a simulink.multisim.MultisimDatastore object.

ds = multisimDatastore(future);

Use the transform function to transform the data in MultisimDatastore named ds.

tds = transform(ds, @(future) max(simOut.logsout{1}.Values.Data));

Read and transform the data in parallel.

maxSignalValues = tds.readall(UseParallel=true);

Run a second post-processing operation.

tds2 = transform(ds,@(future) mean(simOut.logsout{1}.Values.Data));
meanSignalValues = tds2.readall(UseParallel=true);

Version History

Introduced in R2025a