Warning Suppression Request Ignored MATLAB R2017b

조회 수: 2 (최근 30일)
Dave Watson
Dave Watson 2025년 9월 4일
댓글: Dave Watson 2025년 9월 6일
NOTE: This may be, apparently, more of an annoyance than anything else so don't waste your time unless interested.
The warning
"Warning: While loading an object of class 'proplistener':
No constructor 'event.proplistener' with matching signature found.
> In matlab.graphics.internal.figfile.FigFile/read (line 31)
+several more lines"
seen while GUI code is loading a GUIDE FIG-file was suppressed in MATLAB R2015b with the following statements, included in my startup.m:
warning('off', 'MATLAB:class:LoadInvalidDefaultElement') ;
warning('off', 'MATLAB:load:classErrorNoCtor') ;
The GUIDE FIG-file causing the warning was ported from R2015b to R2017b but, in R2017b, those statements no longer suppress the warning message???
Any idea why? Should note that, according to The MathWorks, the event causing the warning should not affect proper execution of the code/GUI but it's annoying and concerning.
BTW, I started seeing this warning in R2015b when I added another control to a toolbar.
  댓글 수: 2
dpb
dpb 2025년 9월 4일
편집: dpb 2025년 9월 4일
Have you checked if the warning has slightly changed spelling or somesuch, maybe, so the prior content isn't matching the present and hence not catching it?
Not sure what would take to be able to generate it for testing; can you post a minimum working example code that produces the warning?
I note that in the link a note has been added as recently as first of 2025 that the warning still occurred in R2022b even though the response says it was fixed as of R2016b; it appears that if it was fixed in R2016b, it has been reintroduced or is coming from somewhere else in the code bowels besides where the patch/correction was made.
Out of curiosity, what if set
w=warning('off','all')
?
ADDENDUM:
>> warning('query', 'MATLAB:class:LoadInvalidDefaultElement')
warning('query', 'MATLAB:load:classErrorNoCtor')
The state of warning 'MATLAB:class:LoadInvalidDefaultElement' is 'on'.
The state of warning 'MATLAB:load:classErrorNoCtor' is 'on'.
>>
in R2021b so the spelling seems to be ok.
dpb
dpb 2025년 9월 4일
warning('query', 'MATLAB:class:LoadInvalidDefaultElement')
The state of warning 'MATLAB:class:LoadInvalidDefaultElement' is 'on'.
warning('query', 'MATLAB:load:classErrorNoCtor')
The state of warning 'MATLAB:load:classErrorNoCtor' is 'on'.
warning('off', 'MATLAB:class:LoadInvalidDefaultElement')
warning('off', 'MATLAB:load:classErrorNoCtor')
warning('query', 'MATLAB:class:LoadInvalidDefaultElement')
The state of warning 'MATLAB:class:LoadInvalidDefaultElement' is 'off'.
warning('query', 'MATLAB:load:classErrorNoCtor')
The state of warning 'MATLAB:load:classErrorNoCtor' is 'off'.
Seems as though the observable behavior is still as expected as far as state and being settable.
GUIDE is no longer even in the distribution although existing apps are supposed to continue to run so I suppose a support request for a version still under active support would be valid, but I don't think they're going to be issuing any patches for R2017b.

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

답변 (1개)

Steven Lord
Steven Lord 2025년 9월 4일
Try running the following command then executing the code or instructions that issue the warning.
dbstop if warning
Once MATLAB enters debug mode, run the following command to check if the warning identifier (used to suppress the warning) has changed.
[~, id] = lastwarn
I don't remember off the top of my head if that specific ID changed (one warning could have been split into two, to be more targeted to a specific circumstance, for example) but it's entirely possible.
  댓글 수: 5
dpb
dpb 2025년 9월 5일
편집: dpb 2025년 9월 5일
Yes, but it was the ID that 'query' hit on in R2021b, Steven...it won't find a message if passed, will it?
The point was that what @Dave Watson posted as being returned are IDs which still exist and setting them to 'off' didn't seem to work.
I was wondering if there were some other way internally that a new/different ID still end up being output to the user as the old ID as seems to be the case here.
warning('query', 'MATLAB:class:LoadInvalidDefaultElement')
The state of warning 'MATLAB:class:LoadInvalidDefaultElement' is 'on'.
warning('query', 'MATLAB:load:classErrorNoCtor')
The state of warning 'MATLAB:load:classErrorNoCtor' is 'on'.
And, in fact, they both exist presently...
That 'off','all' works seems to me to indicate a bug.
Dave Watson
Dave Watson 2025년 9월 6일
Yes, I meant identifier. You can see that's what I've used in both warning() calls.

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

카테고리

Help CenterFile Exchange에서 Programming Utilities에 대해 자세히 알아보기

태그

제품


릴리스

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by