restore
Class: Simulink.SuppressedDiagnostic
Namespace: Simulink
Remove specified diagnostic suppressions
Syntax
restore(SuppressedDiagnostic)
Description
restore(
removes
the specified suppressed diagnostic object.SuppressedDiagnostic
)
Input Arguments
Simulink.SuppressedDiagnostic
object
Examples
To create and then restore a diagnostic suppression, use getDiagnosticObjects.m
, suppressor_script.m
, and the Suppressor_CLI_Demo.slx
model. The getDiagnosticObjects.m
function queries the simulation metadata to access diagnostics that were thrown during simulation. The suppressor_script.m
script contains the commands for suppressing and restoring diagnostics to the Suppressor_CLI_Demo
model.
Open the model. To access Simulink.SimulationMetadata
class, set the ReturnWorkspaceOutputs
parameter value to 'on'
. Simulate the model.
model = 'Suppressor_CLI_Demo'; open_system(model); set_param(model,'ReturnWorkspaceOutputs','on'); out = sim(model);
Create a Simulink.suppressDiagnostic
object, suppression
to suppress the parameter precision loss warning from the Constant block, one
.
suppression = Simulink.SuppressedDiagnostic('Suppressor_CLI_Demo/one',... 'SimulinkFixedPoint:util:fxpParameterPrecisionLoss');
You can restore the diagnostic using the restore
method.
restore(suppression);
To restore all suppressed diagnostics associated with a model, use getDiagnosticObjects.m
, suppressor_script.m
, and the Suppressor_CLI_Demo.slx
model. The getDiagnosticObjects.m
function queries the simulation metadata to access diagnostics that were thrown during simulation. The suppressor_script.m
script contains the commands for suppressing and restoring diagnostics to the Suppressor_CLI_Demo
model. Open the model. To access Simulink.SimulationMetadata
class, set the ReturnWorkspaceOutputs
parameter value to 'on'
. Simulate the model.
model = 'Suppressor_CLI_Demo'; open_system(model); set_param(model,'ReturnWorkspaceOutputs','on'); out = sim(model);
Use the Simulink.suppressDiagnostic
function to suppress the parameter precision loss and parameter underflow warnings from the Constant block, one
.
diags = {'SimulinkFixedPoint:util:fxpParameterPrecisionLoss', 'SimulinkFixedPoint:util:fxpParameterUnderflow'}; Simulink.suppressDiagnostic('Suppressor_CLI_Demo/one',diags);
Use the Simulink.getSuppressedDiagnostics
function to get all suppressions associated with the model, returned as an array of Simulink.SuppressedDiagnostic
objects.
suppressed_diagnostics = Simulink.getSuppressedDiagnostics('Suppressor_CLI_Demo');
Restore all diagnostics using the restore method and iterating through the suppressed_diagnostics
array.
for iter = 1:numel(suppressed_diagnostics) restore(suppressed_diagnostics(iter)); end
Version History
Introduced in R2016b
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Sélectionner un site web
Choisissez un site web pour accéder au contenu traduit dans votre langue (lorsqu'il est disponible) et voir les événements et les offres locales. D’après votre position, nous vous recommandons de sélectionner la région suivante : .
Vous pouvez également sélectionner un site web dans la liste suivante :
Comment optimiser les performances du site
Pour optimiser les performances du site, sélectionnez la région Chine (en chinois ou en anglais). Les sites de MathWorks pour les autres pays ne sont pas optimisés pour les visites provenant de votre région.
Amériques
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)