How to tell if Matlab code is syntactically valid?

Viewed 734

I'm working on a parser for Matlab, using a whole bunch of code from the Matlab Central File Exchange as test data. While sifting through some of it, I found that some of the code I downloaded legitimately shouldn't parse (i.e. Matlab itself won't accept it).

Is there an easy way to check if an m-file (either function or script) contains syntax errors -- perhaps some library function? I'm not looking to run the code, just see if it should parse.

2 Answers
Related