How do I Trace a Warning in the Simulink Diagnostic Viewer to the Block that Generated It?

10 次查看(过去 30 天)
I'm running my simulation and I get the following warning in the Diagnostic Viewer:
Altitude is out of range. Valid altitudes are between 0 and 20000 m.
Component:Simulink | Category:Model warning
I'm pretty sure, but not positive, that the warning is coming from the ISA Atmosphere Model block in the Aerospace Blockset. But I put a scope in the input to the block and it's always between the stated limits, so I'm not sure. I tried the Simuink debugger, but couldn't figure out a way to set a breakpoint on warning.
Nothing in the Diagnostic Viewer suggests where exactly the warning is coming from (i.e., no hyperlink to the offending block as it would show for an error).
I'm not even sure how to set up a block to generate a warning message. Anyway, is there a way for me to figure out where this warning is coming from?

回答(1 个)

Shresth Sharma
Shresth Sharma 2020-3-20
Hi,
It is my understanding that you are using Aerospace toolbox and you are getting a warning while executing the block. In MATLAB there are certain predefined commands, to know the reason behind the warning or to query about warning, you can use:
warning('query')
For going through the warning and back tracing it there is a command available:
warning('on','backtrace')
There are also various other commands available for working with warnings and for understanding more about warnings you can go through the following documentation:

类别

Help CenterFile Exchange 中查找有关 Configure and View Diagnostics 的更多信息

产品


版本

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by