Main Content

read

Read next unread simulation result from simulink.cloud.MultisimDatastore object

Since R2026a

Description

data = read(mds) reads the next unread simulation result from the datastore mds. Use read to incrementally process results of large multiple simulation jobs when the total amount of data exceeds available memory.

[data,info] = read(mds) returns additional information about the simulation results.

Examples

collapse all

Create a simulink.cloud.MultisimDatastore object and read the simulation results.

Suppose you have already created a simulink.multisim.DesignStudy object and have a cloud cluster. Use the batchsim function with the design study object to launch a simulation on a cloud cluster.

cloudClusterURL = "yourcluster.example.com";
cloudCluster = simulink.cloud.addCluster('myCloudCluster',cloudClusterURL);
job = batchsim(cloudCluster,designStudy);

Create a datastore using multisimDatastore to fetch and store the simulation results from the simulink.cloud.Job object.

mds = multisimDatastore(job);

You can check if the datastore has unread data using hasdata. The while loop iterates through the entire datastore and the read function reads the simulation results for each simulation.

while hasdata(mds)
  simOut = read(mds);
end

You can reset the read position of the datastore using reset and start reading again from the first set of simulation results.

reset(mds)
data = read(mds);

Input Arguments

collapse all

Datastore to read, specified as a simulink.cloud.MultisimDatastore object.

Output Arguments

collapse all

Simulation results read from datastore, returned as a Simulink.SimulationOutput object.

Information about simulation results, returned as a structure. The structure contains three fields:

  • Filename– Fully resolved path containing the path string, file name, and file extension.

  • FileSize– Size of the file in kB.

  • RunId– ID number of the run.

Version History

Introduced in R2026a