Documentation Center

  • Trial Software
  • Product Updates

Contents

Simulink.sdi.refresh

Refresh Simulation Data Inspector

Syntax

Simulink.sdi.refresh

Description

Simulink.sdi.refresh refresh the Simulation Data Inspector repository and the tool.

Examples

expand all

Record Data During Parallel Simulations

This example shows how to run multiple simulations in a parfor loop and record each run in the Simulation Data Inspector tool.

Open the Simulation Data Inspector.

Simulink.sdi.view;

Load the model.

mdl = 'slexAircraftExample';
load_system(mdl);

Get the location of the simulation data repository.

src = Simulink.sdi.getSource();

Start a parallel pool with 4 workers.

parpool(4);

Run the simulation in a parfor loop.

parfor i=1:4
   % Set the location of the simulation data repository of this 
   % worker to be the same for aggregating the data
   Simulink.sdi.setSource(src);
   % Run the simulation
   simOut = sim(mdl,'SaveOutput','on',...
                'SaveFormat','StructureWithTime',...
                'ReturnWorkspaceOutputs','on');
   % Create a simulation run in the Simulation Data Inspector
   Simulink.sdi.createRun(['Run' num2str(i)],'namevalue',...
                          {'simout'},{simOut});
end

Delete the current parallel pool and close all of the models.

parpool close;
bdclose all;

Refresh the Simulation Data Inspector.

Simulink.sdi.refresh();

See Also

|

Was this topic helpful?