Warning Suppression Request Ignored MATLAB R2017b

34 views (last 30 days)
Dave Watson
Dave Watson on 4 Sep 2025 at 15:39
Commented: Dave Watson on 6 Sep 2025 at 11:21
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 Comments
dpb
dpb on 4 Sep 2025 at 16:31
Edited: dpb on 4 Sep 2025 at 16:35
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 on 4 Sep 2025 at 16:42
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.

Sign in to comment.

Answers (1)

Steven Lord
Steven Lord on 4 Sep 2025 at 17:28
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 Comments
dpb
dpb on 5 Sep 2025 at 19:24
Edited: dpb on 5 Sep 2025 at 19:26
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 on 6 Sep 2025 at 11:21
Yes, I meant identifier. You can see that's what I've used in both warning() calls.

Sign in to comment.

Categories

Find more on Programming Utilities in Help Center and File Exchange

Products


Release

R2017b

Community Treasure Hunt

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

Start Hunting!