On most instances of MATLAB I\'ve used, whenever I had a bug in my code the error message in the command window would show the line number.
However on the computer I am
What you are doing is using Run Section
or Run and Advance
as @canzar said. If you run scripts like this there is no 'line number', just as when you copy-paste code and run it in the command-window will not show you the line number on the error.
If you run the script using run
or by pressing F5 it does know the line number and then prints that on the error statement. Good to know for debugging is to go to the tab editor->breakpoints->dbstop on error. If you press that it will keep your variables as present when the memory occurs, as opposed to throwing everything out when debugging functions.