From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: check syntax errors in m file
Date: Thu, 17 Jun 2010 22:37:04 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 26
Message-ID: <hve82g$7ve$>
References: <h37tdl$gpd$> <hve52s$1o9$> <hve7a5$k9r$>
Reply-To: <HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: 1276814224 8174 (17 Jun 2010 22:37:04 GMT)
NNTP-Posting-Date: Thu, 17 Jun 2010 22:37:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2305417
Xref: comp.soft-sys.matlab:645971

Thanks for the quick response Matt.

However, your suggestion unfortunately doesn't work. For example, if I write this function:

function myFunc()

for ii=1:10

In the editor, line 4 (the un-ended for-loop) shows up as a red error. However, running mlint doesn't return the word "error" at all:

>> mlint('myFunc.m')
L 3 (C 4): Terminate statement with semicolon to suppress output (in functions).
L 4 (C 1-3): An END might be missing, possibly matching FOR.
L 6 (C 1-3): The value assigned to variable 'bar' might be unused.

From the m-lint output, there's no way to tell that the 2nd message is an error, while #1 and #3 are warnings.

Any other thoughts?