Get the msgid of a certain warning?
조회 수: 8 (최근 30일)
이전 댓글 표시
When I generate c-code from my Simulink model, 19000+ warnings were generated as ~20 categories. One of category is ' An ERT or ERT derived target is required to preserve the names of alias data types in the generated code. Reverting to builtin types during code generation.' . I want to ignore this type of warning by using the [warning('off', msgid)] command. However, because these warnings lie in the middle of all warnings, I cannot get their msgid by using ' _ lastwarn_' function. Is there anyway to get msgid just based on the warning texts?
Thanks a lot!
댓글 수: 0
채택된 답변
Robert U
2017년 9월 27일
Hi Guanyu Wang:
use the function warning with enabled verbosity to display extended warning messages (including suppression command):
warning('on','verbose')
The command has to be written before executing your code containing warnings. Shutting it off again is done straight forward by
warning('off','verbose')
Answer found here:
Kind regards,
Robert
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 General Applications에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!