Main Content

sldiagviewer.reportSimulationMetadataDiagnostics

Display errors and warnings of simulation output object in Diagnostic Viewer

Description

example

sldiagviewer.reportSimulationMetadataDiagnostics(simOutputObject)displays errors and warnings of a simulation output object in the Diagnostic Viewer.

Examples

collapse all

Simulate a model, place theSimulink.SimulationOutputobject insimOut, and use the回购rtSimulationMetadataDiagnosticsfunction to display errors and warnings in the Diagnostic Viewer.

Create a singleSimulationInputobject for the model.

>>vdp set_param('vdp/Mu',“获得”,'z') delete_line('vdp','Product/1','Mu/1'); model ='vdp'; in = Simulink.SimulationInput(model);

Create an array ofSimulationInputobjects by using theforloop.

in(1:5) = in;

Simulate all theSimulationInputobjects in the array to output the indices of the models with errors or warnings. The output is returned in a singleSimulink.SimulationOutputobject.

simOut = sim(in); sldiagviewer.reportSimulationMetadataDiagnostics(simOut(1));

Open the Diagnostic Viewer to show errors and warnings in the first model of the SimulationOutput object.

sldiagviewer.reportSimulationMetadataDiagnostics(simOut(1));

Input Arguments

collapse all

Simulink.SimulationOutputobject containing errors and warnings that are generated when you simulate the model.

Introduced in R2020b