필터 지우기
필터 지우기

How do I turn off a particular warning in MATLAB?

조회 수: 159 (최근 30일)
MathWorks Support Team
MathWorks Support Team 2010년 5월 19일
댓글: Walter Roberson 2020년 1월 23일
I am receiving a warning that I am not interested in. I would like to suppress the display of that warning even though I do not know the warning identifier.

채택된 답변

MathWorks Support Team
MathWorks Support Team 2010년 5월 19일
This change has been incorporated into the documentation in Release 2010a (R2010a). For previous releases, read below for any additional information:
The general method for suppressing a warning message is to issue the following command at the prompt:
warning('off', MSGID)
The string 'MSGID' is a unique identifier that corresponds to a particular warning message.
There are two ways to determine what a warning's identifier is, so that it can be suppressed later:
1) Just after the specific warning has been issued, run the following command:
[a, MSGID] = lastwarn();
This will save the message identifier to the variable MSGID. Then you can use the command given above to turn that particular warning off.
2) Turn on verbose warning messages with the following command:
warning on verbose
When warnings are displayed, they will include the command that can be used to turn that warning off.
  댓글 수: 1
Walter Roberson
Walter Roberson 2020년 1월 23일
I just noticed a moment ago that MATLAB:hg:EraseModeIgnored cannot be turned off in practice; the message is produced anyhow.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Argument Definitions에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by