Main Content

sldiagviewer.reportSimulationMetadataDiagnostics

Display errors and warnings in Simulink.SimulationOutput in Diagnostic Viewer

Description

example

sldiagviewer.reportSimulationMetadataDiagnostics(simOut) displays errors and warnings saved in the Simulink.SimulationOutput object simOut in the Diagnostic Viewer.

Examples

collapse all

Simulate a model and assign the output to the Simulink.SimulationOutput object in simOut. Then, use the reportSimulationMetadataDiagnostics function to display errors and warnings in the Diagnostic Viewer.

Create a single SimulationInput object for the model.

vdp 
set_param('vdp/Mu','Gain','z')
delete_line('vdp','Product/1','Mu/1');
model = 'vdp';
in = Simulink.SimulationInput(model);

Create an array of SimulationInput objects by using the for loop.

 in(1:5) = in;

Simulate all the SimulationInput objects in the array to output the indices of the models with errors or warnings. The output is returned in a single Simulink.SimulationOutput object.

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

Open the Diagnostic Viewer to show errors and warnings in the Simulink.SimulationOutupt object with the results from the first simulation.

sldiagviewer.reportSimulationMetadataDiagnostics(simOut(1));

Input Arguments

collapse all

Simulation output that contains errors and warnings, specified as a Simulink.SimulationOutput object.

Version History

Introduced in R2020b