Rare examples of confusing error messages
조회 수: 9 (최근 30일)
이전 댓글 표시
Usually Matlab creates very helpful error messages, e.g.:
??? Subscript indices must either be real positive integers or logicals.
It does not require much experience to identify the source of this error rapidly. (Finding a solution is completely different story!) Compared with e.g. the messages of famous operating systems or the GCC compiler, the high quality of these messages is extremely helpful.
Do you know counter-examples? Some misleading or irrelevant messages created by Matlab?
댓글 수: 3
James Muchechetere
2019년 8월 23일
Yes. Got this message in r2017a:
Error using CPFSKModulator/parenReference
When the BitInput property is set to true, inputs must have be double or logical.
채택된 답변
Andreas Goser
2012년 4월 24일
My all-time favourite is
Caught unexpected exception of unknown type.
댓글 수: 7
Walter Roberson
2019년 5월 4일
I think that solution migrated to https://www.mathworks.com/matlabcentral/answers/99628-why-do-i-receive-an-assertion-when-i-specify-the-property-xdatasource-in-plot
Walter Roberson
2019년 5월 4일
편집: Walter Roberson
2019년 5월 4일
It appears there is also the cause at https://www.mathworks.com/matlabcentral/answers/224739-matlab-r2015a-startup-error-regarding-java-lang-runtimeexception which related to Java and temporary directories and loading libraries.
There may also be causes related to loadlib() or possiby TCP; https://www.mathworks.com/matlabcentral/answers/142270-caught-unexpected-exception-of-unknown-type-tcp-ip-device-connection
추가 답변 (8개)
Daniel Shub
2012년 4월 23일
Definitely on the irrelevant side, but luckily it was taken care of pretty quickly. I think it might be the first bug I reported to TMW.
Basically someone at TMW left a debugging message in the serial port object callback so that it would always rethrow the last warning.
Oleg Komarov
2012년 4월 23일
The guilty one:
foo('')
Undefined function 'foo' for input arguments of type 'char'.
No inputs:
foo
Undefined function or variable 'foo'.
Use as variable OR function?
clear foo
sum(foo)
Undefined function or variable 'foo'.
The two error messages considered together make you think that the first one is simply not properly behaving BECAUSE of the input.
However, most commonly it's the case of "undefined function" which is already implemented!
I suggest to suppress the first one and throw always the second message.
댓글 수: 5
Image Analyst
2012년 4월 24일
Seems to me it should look it up by function name (m-filename). So it should look for foo.m, not all possible functions of any name that take a class char (which would be a lot) and then determine if any of them are named foo.
Daniel Shub
2012년 4월 23일
Another unhelpful aspect of error handling in MATLAB is if you catch an error in a callback and then rethrow the error, you lose the stack information.
댓글 수: 0
Walter Roberson
2012년 4월 26일
Invoke Error, Dispatch Exception: Exception Error Occurred
isn't the most enlightening of messages...
댓글 수: 0
Adam
2017년 1월 17일
was one I got the other day. Not sure what I had done to get it though! I especially like the one word per line formatting!
댓글 수: 2
Steven Lord
2017년 1월 17일
I searched a little bit and I'm not sure that's from a MathWorks function. [It is being displayed in a msgbox with the 'error' Icon, I believe, but that's a function anyone can call.]
Adam
2017년 1월 18일
It's definitely something deep down as I got it again yesterday when I tried to open a file that I had moved and was actually not on my path any more. I hit Ctrl C or pause or something and ended up with that message. It isn't something in my own code or 3rd party code that I have though so not sure what its source is!
참고 항목
카테고리
Help Center 및 File Exchange에서 Whos에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!