How to prevent display of specific warning message in matlab?

조회 수: 6 (최근 30일)
pavan sunder
pavan sunder 2016년 12월 19일
편집: Jan 2016년 12월 19일
How to prevent display of specific warning message in matlab?
for example my warning message is:
Warning: Invalid MinPeakHeight. There are no data points greater than MinPeakHeight.
>In findpeaks>removePeaksBelowMinPeakHeight (line 373)
In findpeaks (line 139)
i want to prevent dispaly of this warning in my command window.PLZ suggest me a solution in matlab.. i tried using
warning('off','Invalid MinPeakHeight. There are no data points greater than MinPeakHeight');
but it says invalid msd id. plz suggest me the suitable way to specify msgID

답변 (1개)

Jan
Jan 2016년 12월 19일
편집: Jan 2016년 12월 19일
Citing the documentation of warning:
WARNING('OFF', 'MSGID') and WARNING('ON', 'MSGID') disable and enable the
display of any warning tagged with message identifier MSGID. (Use LASTWARN
to determine the identifier of a warning, or use the WARNING VERBOSE feature
described below.)
So use either lastwarn or warning verbose to find the message ID. If contains 2 ':' characters. Then this disables the warning:
warning('off', MsgID)
Alternatively you find the ID in
findpeaks>removePeaksBelowMinPeakHeight (line 373)

카테고리

Help CenterFile Exchange에서 Error Handling에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by