Try this line from command line. There is no syntax error in try-catch-end.
try bad_function_name(1); catch warning('one'); end
Now use the following in the MATLAB Editor:
%%1st cell
%%2nd cell
try bad_function_name(1); catch warning('one'); end
MATLAB M-lint will show a "PARSE ERROR" with the Catch statement :
"Parse error at '(': usage might be invalid MATLAB syntax."
Due to a Parse Error in the Editor cell mode highlighting gets disrupted. However, if it were an error MATLAB should throw the error at the command prompt as well.
Is this a issue with the MATLAB parser or the CATCH statement?
Is it a discrepancy with the syntax or is it an issue with the M-lint message showing up as a "Parse Error" rather than a "WARNING"/"Suggestion" which will not effect the cell mode functionality.
Best Answer