Main Content

Simulink.suppressDiagnostic

特定のブロックからの診断を非表示にする

説明

Simulink.suppressDiagnostic(source,message_id) は、source で指定されたブロックがスローした message_id の表す診断のすべてのインスタンスを非表示にします。

Simulink.suppressDiagnostic(diagnostic) は、MSLDiagnostic オブジェクト diagnostic に関連付けられた診断を非表示にします。

すべて折りたたむ

Simulink® モデルのブロックによってスローされた診断警告を非表示にします。

モデル Suppressor_CLI_Demo を読み込みます。

model = 'Suppressor_CLI_Demo';
load_system(model);

Simulink.SimulationMetadata クラスにアクセスするには、ReturnWorkspaceOutputs パラメーター値を 'on' に設定します。

set_param(model,'ReturnWorkspaceOutputs','on');

モデルをシミュレートします。

out1 = sim(model);
Warning: Parameter precision loss occurred for 'Value' of 'Suppressor_CLI_Demo/one'.  The original value of the parameter, 0.01, cannot be represented exactly using the run-time data type sfix16_En5. The value is quantized to 0. Quantization error occurred with an absolute difference of 0.01 and a relative difference of 1. 
Suggested Actions:
    • To control the level of precision loss at which a warning or error is issued, adjust the diagnostic threshold settings. - Open
    • Inspect details in the Parameter Quantization Advisor. - Open
    •  - Suppress

Warning: Parameter underflow occurred for 'Value' of 'Suppressor_CLI_Demo/one'.  The value of the parameter, 0.01, is non-zero, but after quantization to the run-time data type sfix16_En5, the value is zero (0). Quantization error occurred with an absolute difference of 0.01 and a relative difference of 1. 
Suggested Actions:
    • Inspect details in the Parameter Quantization Advisor. - Open
    •  - Suppress

Warning: Saturate on overflow detected. This originated from 'Suppressor_CLI_Demo/Convert/FixPt To FixPt1'
Suggested Actions:
    •  - Suppress

Warning: Saturate on overflow detected. This originated from 'Suppressor_CLI_Demo/Convert/FixPt To FixPt2'
Suggested Actions:
    •  - Suppress

Warning: Saturate on overflow detected. This originated from 'Suppressor_CLI_Demo/Convert/FixPt To FixPt3'
Suggested Actions:
    •  - Suppress

Constant ブロック one によってスローされたパラメーターの桁落ちに関する警告を非表示にします。

Simulink.suppressDiagnostic('Suppressor_CLI_Demo/one',...
     'SimulinkFixedPoint:util:fxpParameterPrecisionLoss');

関数 getDiagnosticObjects.m は、シミュレーション メタデータを照会して、シミュレーション中にスローされた診断にアクセスします。suppressor_script.m には、Suppressor_CLI_Demo に対する診断を非表示または元に戻すためのコマンドが含まれます。

モデルをシミュレートします。

out2 = sim(model);
Warning: Parameter underflow occurred for 'Value' of 'Suppressor_CLI_Demo/one'.  The value of the parameter, 0.01, is non-zero, but after quantization to the run-time data type sfix16_En5, the value is zero (0). Quantization error occurred with an absolute difference of 0.01 and a relative difference of 1. 
Suggested Actions:
    • Inspect details in the Parameter Quantization Advisor. - Open
    •  - Suppress

Warning: Saturate on overflow detected. This originated from 'Suppressor_CLI_Demo/Convert/FixPt To FixPt1'
Suggested Actions:
    •  - Suppress

Warning: Saturate on overflow detected. This originated from 'Suppressor_CLI_Demo/Convert/FixPt To FixPt2'
Suggested Actions:
    •  - Suppress

Warning: Saturate on overflow detected. This originated from 'Suppressor_CLI_Demo/Convert/FixPt To FixPt3'
Suggested Actions:
    •  - Suppress

パラメーターの桁落ちに関する警告が非表示になります。

入力引数

すべて折りたたむ

診断のソース。ブロック パス、ブロック ハンドル、ブロック パスの cell 配列、またはブロック ハンドルの cell 配列として指定します。

ブロック パスを取得するには、関数 gcb を使用します。

ブロック ハンドルを取得するには、関数 getSimulinkBlockHandle を使用します。

データ型: char | cell

診断のメッセージ識別子。文字ベクトル、または文字ベクトルの cell 配列として指定します。シミュレーションに関連付けられた Simulink.SimulationMetadata オブジェクトの ExecutionInfo プロパティにアクセスすることで、シミュレーション中にスローされた診断のメッセージ識別子を検出できます。また、関数 lastwarn を使用することもできます。

データ型: char | cell

MSLDiagnostic オブジェクトとして指定された診断。Simulink.SimulationMetadata オブジェクトの ExecutionInfo プロパティを通じて MSLDiagnostic オブジェクトにアクセスします。

データ型: struct