Contenu principal

wait

R2026b

Wait for simulink.multisim.Future simulations to complete

Since R2024a

Syntax

Description

wait(f) blocks the MATLAB® command prompt until all simulations associated with the simulink.multisim.Future object f complete. wait does not return a value. If simulations have already finished or failed, wait returns without blocking.

Examples

collapse all

Suppose you have configured a set of simulations using a simulink.multisim.DesignStudy object stdy. Run the simulations in parallel.

Run simulations with a specified output location.

outputDir = fullfile(pwd,"myResults");
mkdir(outputDir);
f = parsim(stdy, OutputLocation=outputDir);

Block interaction with the MATLAB command prompt until the simulations finish. When they complete, check the state.

wait(f);
f.State
ans =
    'finished'

Input Arguments

collapse all

Object representing running or completed simulations, specified as a simulink.multisim.Future object created when you call parsim with a DesignStudy object as the input argument.

Tips

  • Use wait instead of fetchOutputs when you do not need to load the results into memory. Consider using wait with multisimDatastore to process results incrementally.

  • fetchOutputs calls wait internally. Use when you want to check state or timing properties before fetching outputs.

Version History

Introduced in R2024a