Follow up on "... why-do-i-get-warning-cannot-load-an-object-of-class-listener-when-i-open-figure" (MATLAB R2015b)
조회 수: 9 (최근 30일)
이전 댓글 표시
See URL at end. This is a follow up question.
I get this error - warning, actually - but only after adding another toggle tool to my toolbar? There are already several toggles and pushbuttons and there was no issue until I added just one more? New control does not appear to be any different from the rest??
Is there a limit on the number of controls on a toolbar?
I have suppressed the warning messages but makes me nervous!
Here is the error (warning):
------------------------------
>> hgDataVars = load(filename, '-mat', '-regexp', '^hg[M]'); % This statement is from read.m
Warning: Cannot load an object of class 'proplistener':
No matching constructor signature found.
Warning: During load:
An invalid default object has been detected while loading a heterogeneous array of class event.proplistener. An empty array
of class event.proplistener will be returned.
------------------------------
This is the original question in answers:
댓글 수: 0
답변 (1개)
Meet
2025년 5월 15일
편집: Meet
2025년 5월 15일
Hi Dave,
The cause of the warning message is that while loading the object from the MAT-File, MATLAB was not able to attach the listener back to the object. If you check for 'proplist' property of the loaded object, you will find it is empty.
A listener object is attached to the object as long as the object remains in scope. Once you save the object it goes out of scope, so the listener for the saved object is destroyed. In order to keep the listener with the object as it is saved and loaded back into the workspace, you will need to define the "LOADOBJ" and "SAVEOBJ" functions in your class definition file.
Please refer to the Help documentation on "SAVEOBJ" and "LOADOBJ" by typing the following at the MATLAB Command Prompt:
doc saveobj
doc loadobj
For more information, you could refer to the following MATLAB Answer: https://www.mathworks.com/matlabcentral/answers/99297-why-do-i-receive-a-error-loading-an-object-of-class-proplistener-warning-when-i-load-my-object-t
Hope this helps resolves the issue
참고 항목
카테고리
Help Center 및 File Exchange에서 Object Save and Load에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!