メインコンテンツ

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 '<a href="matlab:open_and_hilite_hyperlink ('Suppressor_CLI_Demo/one','error')">Suppressor_CLI_Demo/one</a>'.  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. - <a href="matlab:Simulink.output.ParamDiagnosticFixits.fix('HighlightParam','Suppressor_CLI_Demo/one','ParameterPrecisionLossMsg');">Open</a>
    • To review details in the Parameter Quantization Advisor app, click the Open button. - <a href="matlab:Simulink.output.ParamDiagnosticFixits.fix('OpenParamQuantizeManager','Value','Suppressor_CLI_Demo/one');">Open</a>
    •  - <a href="matlab:Simulink.SuppressedDiagnostic({'Suppressor_CLI_Demo/one'},'SimulinkFixedPoint:util:fxpParameterPrecisionLoss');">Suppress</a>

Warning: Parameter underflow occurred for 'Value' of '<a href="matlab:open_and_hilite_hyperlink ('Suppressor_CLI_Demo/one','error')">Suppressor_CLI_Demo/one</a>'.  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:
    • To review details in the Parameter Quantization Advisor app, click the Open button. - <a href="matlab:Simulink.output.ParamDiagnosticFixits.fix('OpenParamQuantizeManager','Value','Suppressor_CLI_Demo/one');">Open</a>
    •  - <a href="matlab:Simulink.SuppressedDiagnostic({'Suppressor_CLI_Demo/one'},'SimulinkFixedPoint:util:fxpParameterUnderflow');">Suppress</a>

Warning: Saturate on overflow detected. This originated from '<a href="matlab:open_and_hilite_hyperlink ('Suppressor_CLI_Demo/Convert/FixPt To FixPt1','error')">Suppressor_CLI_Demo/Convert/FixPt To FixPt1</a>'
Suggested Actions:
    •  - <a href="matlab:Simulink.SuppressedDiagnostic({'Suppressor_CLI_Demo/Convert/FixPt To FixPt1'},'SimulinkFixedPoint:util:Saturationoccurred');">Suppress</a>

Warning: Saturate on overflow detected. This originated from '<a href="matlab:open_and_hilite_hyperlink ('Suppressor_CLI_Demo/Convert/FixPt To FixPt2','error')">Suppressor_CLI_Demo/Convert/FixPt To FixPt2</a>'
Suggested Actions:
    •  - <a href="matlab:Simulink.SuppressedDiagnostic({'Suppressor_CLI_Demo/Convert/FixPt To FixPt2'},'SimulinkFixedPoint:util:Saturationoccurred');">Suppress</a>

Warning: Saturate on overflow detected. This originated from '<a href="matlab:open_and_hilite_hyperlink ('Suppressor_CLI_Demo/Convert/FixPt To FixPt3','error')">Suppressor_CLI_Demo/Convert/FixPt To FixPt3</a>'
Suggested Actions:
    •  - <a href="matlab:Simulink.SuppressedDiagnostic({'Suppressor_CLI_Demo/Convert/FixPt To FixPt3'},'SimulinkFixedPoint:util:Saturationoccurred');">Suppress</a>

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 '<a href="matlab:open_and_hilite_hyperlink ('Suppressor_CLI_Demo/one','error')">Suppressor_CLI_Demo/one</a>'.  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:
    • To review details in the Parameter Quantization Advisor app, click the Open button. - <a href="matlab:Simulink.output.ParamDiagnosticFixits.fix('OpenParamQuantizeManager','Value','Suppressor_CLI_Demo/one');">Open</a>
    •  - <a href="matlab:Simulink.SuppressedDiagnostic({'Suppressor_CLI_Demo/one'},'SimulinkFixedPoint:util:fxpParameterUnderflow');">Suppress</a>

Warning: Saturate on overflow detected. This originated from '<a href="matlab:open_and_hilite_hyperlink ('Suppressor_CLI_Demo/Convert/FixPt To FixPt1','error')">Suppressor_CLI_Demo/Convert/FixPt To FixPt1</a>'
Suggested Actions:
    •  - <a href="matlab:Simulink.SuppressedDiagnostic({'Suppressor_CLI_Demo/Convert/FixPt To FixPt1'},'SimulinkFixedPoint:util:Saturationoccurred');">Suppress</a>

Warning: Saturate on overflow detected. This originated from '<a href="matlab:open_and_hilite_hyperlink ('Suppressor_CLI_Demo/Convert/FixPt To FixPt2','error')">Suppressor_CLI_Demo/Convert/FixPt To FixPt2</a>'
Suggested Actions:
    •  - <a href="matlab:Simulink.SuppressedDiagnostic({'Suppressor_CLI_Demo/Convert/FixPt To FixPt2'},'SimulinkFixedPoint:util:Saturationoccurred');">Suppress</a>

Warning: Saturate on overflow detected. This originated from '<a href="matlab:open_and_hilite_hyperlink ('Suppressor_CLI_Demo/Convert/FixPt To FixPt3','error')">Suppressor_CLI_Demo/Convert/FixPt To FixPt3</a>'
Suggested Actions:
    •  - <a href="matlab:Simulink.SuppressedDiagnostic({'Suppressor_CLI_Demo/Convert/FixPt To FixPt3'},'SimulinkFixedPoint:util:Saturationoccurred');">Suppress</a>

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

入力引数

すべて折りたたむ

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

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

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

データ型: char | cell

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

データ型: char | cell

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

データ型: struct

バージョン履歴

R2016b で導入