Path: news.mathworks.com!not-for-mail
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$1@fred.mathworks.com>
References: <h37tdl$gpd$1@fred.mathworks.com> <hve52s$1o9$1@fred.mathworks.com> <hve7a5$k9r$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1276814224 8174 172.30.248.37 (17 Jun 2010 22:37:04 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 17 Jun 2010 22:37:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2305417
Xref: news.mathworks.com 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()

foo=2
for ii=1:10
    disp(ii);
bar=foo+3;
--------------------

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?

Thanks,
Mason