Contenu principal

fetchOutputs

R2026b

Retrieve simulation outputs from simulink.multisim.Future object

Since R2024a

Description

simOut = fetchOutputs(future) retrieves the simulation outputs from a simulink.multisim.Future object. fetchOutputs returns an N-by-1 array of Simulink.SimulationOutput objects, where N is the number of simulations in the design study. If the simulations are not yet finished, fetchOutputs waits until they complete.

Examples

collapse all

Run a design study using the vdp model and retrieve the simulation results from the simulink.multisim.Future object.

Define a parameter sweep for Mu and create a design study.

mdl = "vdp";
openExample("simulink_general/VanDerPolOscillatorExample",SupportingFile=mdl);

muValues = [0.5:0.25:5];
paramRange = simulink.multisim.Variable("Mu",uValues);
exht = simulink.multisim.Exhaustive(paramRange);
stdy = simulink.multisim.DesignStudy(mdl,exht);

Run the design study using parsim.

f = parsim(stdy);
f.State
ans =
    'running'

Fetch all outputs. The fetchOutputs function blocks until simulations finish.

outputs = fetchOutputs(f)
outputs =
  19x1 Simulink.SimulationOutput array

Input Arguments

collapse all

Object representing running or completed simulations, created by calling parsim with a DesignStudy object.

Output Arguments

collapse all

Simulation object containing logged simulation results, represented by a Simulink.SimulationOutput array.

Tips

  • fetchOutputs calls wait internally. You do not need to call wait first.

  • You can call fetchOutputs multiple times on the same future object.

  • For large result sets, use multisimDatastore instead to process results incrementally without loading everything into memory.

  • If any simulation failed or was canceled, calling fetchOutputs triggers an error.

Version History

Introduced in R2024a