Rare examples of confusing error messages
Mostra commenti meno recenti
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 Commenti
Daniel Shub
il 23 Apr 2012
I like this question.
James Muchechetere
il 23 Ago 2019
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.
Risposta accettata
Più risposte (8)
Jan
il 24 Apr 2012
2 Commenti
Andreas Goser
il 24 Apr 2012
Such eastereggs have been removed...
+1
Image Analyst
il 26 Apr 2012
Too bad. Why can't people have some fun?
Daniel Shub
il 23 Apr 2012
2 voti
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.
1 Commento
Jan
il 23 Apr 2012
Oleg Komarov
il 23 Apr 2012
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 Commenti
Image Analyst
il 23 Apr 2012
I agree. If it's not defined for ANY input whatsoever, then it should say so, rather than make you think it's there but just expects doubles or whatever.
Walter Roberson
il 24 Apr 2012
It's because of method lookup by class. If it has an argument then it has to look at the functions defined for the class of the argument and it has to ignore all other methods of all other classes. It would be relatively expensive to go back and do a second search to find if there happens to be a function with that name in some other class.
Oleg Komarov
il 24 Apr 2012
The question is wether the additional info causes more harm than it would if the info about the class was always omitted.
Image Analyst
il 24 Apr 2012
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.
Jan
il 24 Apr 2012
Daniel Shub
il 23 Apr 2012
1 voto
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.
Walter Roberson
il 26 Apr 2012
Invoke Error, Dispatch Exception: Exception Error Occurred
isn't the most enlightening of messages...
Jan
il 17 Gen 2017
Adam
il 17 Gen 2017
1 voto

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 Commenti
Steven Lord
il 17 Gen 2017
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
il 18 Gen 2017
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!
Categorie
Scopri di più su Performance and Memory in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!