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 で導入
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.
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- 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)