Path: news.mathworks.com!not-for-mail
From: "Jiaquan Huo" <jiaquan@hotmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: how to access results in Matlab from shell
Date: Tue, 27 Oct 2009 05:37:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 15
Message-ID: <hc60tu$q7t$1@fred.mathworks.com>
Reply-To: "Jiaquan Huo" <jiaquan@hotmail.com>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1256621822 26877 172.30.248.35 (27 Oct 2009 05:37:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 27 Oct 2009 05:37:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2061540
Xref: news.mathworks.com comp.soft-sys.matlab:580255


Hi,

I read on MATLAB Central about something like

result=$(echo "3+3"|matlab) to have the result of 3+3 calculated in matlab in the variable result in bash. I tried it on my Cygwin, but can't get 6 in the variable result.

With 'result=$(echo "3+3"|matlab), MATLAB is just not doing any calculation.

With 'result=$(echo "3+3"| matlab -r), MATLAB calculates 3+3, but the result is not returned in result.

What have I done wrong here?

Thanks for any advice in advance.

Jiaquan