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
パラメーターの桁落ちに関する警告が非表示になります。
入力引数
source
— 診断をスローするブロックまたはモデル オブジェクト
ブロック パス | ブロック ハンドル
診断のソース。ブロック パス、ブロック ハンドル、ブロック パスの cell 配列、またはブロック ハンドルの cell 配列として指定します。
ブロック パスを取得するには、関数 gcb
を使用します。
ブロック ハンドルを取得するには、関数 getSimulinkBlockHandle
を使用します。
データ型: char
| cell
message_id
— 診断のメッセージ識別子
メッセージ識別子 | メッセージ識別子の cell 配列
診断のメッセージ識別子。文字ベクトル、または文字ベクトルの cell 配列として指定します。シミュレーションに関連付けられた Simulink.SimulationMetadata
オブジェクトの ExecutionInfo
プロパティにアクセスすることで、シミュレーション中にスローされた診断のメッセージ識別子を検出できます。また、関数 lastwarn
を使用することもできます。
データ型: char
| cell
diagnostic
— 診断オブジェクト
MSLDiagnostic
オブジェクト
MSLDiagnostic
オブジェクトとして指定された診断。Simulink.SimulationMetadata
オブジェクトの ExecutionInfo
プロパティを通じて MSLDiagnostic
オブジェクトにアクセスします。
データ型: struct
MATLAB コマンド
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは MATLAB コマンドをサポートしていません。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- 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)