<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/262090</link>
    <title>MATLAB Central Newsreader - start matlab in linux shell without startup message and prompt</title>
    <description>Feed for thread: start matlab in linux shell without startup message and prompt</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Thu, 01 Oct 2009 15:40:17 -0400</pubDate>
      <title>start matlab in linux shell without startup message and prompt</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/262090#683987</link>
      <author>Le He</author>
      <description>Hi,&lt;br&gt;
in bash I like to pipe some expression to matlab:&lt;br&gt;
$ result=$(echo &quot;3+3&quot;|matlab)&lt;br&gt;
$ echo $result&lt;br&gt;
Warning: No display specified. You will not be able to display graphics on the screen. &amp;lt; M A T L A B (R) &amp;gt; Copyright 1984-2008 The MathWorks, Inc. Version 7.6.0.324 (R2008a) February 10, 2008 To get started, type one of these: helpwin, helpdesk, or demo. For product information, visit www.mathworks.com. Warning: Name is nonexistent or not a directory: /matlab. &amp;gt; In path at 110 In startup at 4 In matlabrc at 272 Warning: Name is nonexistent or not a directory: /toolbox. &amp;gt; In path at 110 In startup at 15 In matlabrc at 272 &amp;gt;&amp;gt; ans = 6 &amp;gt;&amp;gt;&lt;br&gt;
&lt;br&gt;
But I don't want the message and prompt in the result variable. So is there any way to make result just store 6, e.e. &lt;br&gt;
$ echo $result&lt;br&gt;
6&lt;br&gt;
&lt;br&gt;
Thanks and regards!</description>
    </item>
    <item>
      <pubDate>Thu, 01 Oct 2009 17:08:56 -0400</pubDate>
      <title>Re: start matlab in linux shell without startup message and prompt</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/262090#684010</link>
      <author>tristram.scott@ntlworld.com (Tristram Scott)</author>
      <description>Le He &amp;lt;flylehe@hotmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; Hi,&lt;br&gt;
&amp;gt; in bash I like to pipe some expression to matlab:&lt;br&gt;
&amp;gt; $ result=$(echo &quot;3+3&quot;|matlab)&lt;br&gt;
&amp;gt; $ echo $result&lt;br&gt;
&amp;gt; Warning: No display specified. You will not be able to display graphics&lt;br&gt;
on the screen. &amp;lt; M A T L A B (R) &amp;gt; Copyright 1984-2008 The MathWorks, Inc.&lt;br&gt;
Version 7.6.0.324 (R2008a) February 10, 2008 To get started, type one of&lt;br&gt;
these: helpwin, helpdesk, or demo. For product information, visit&lt;br&gt;
www.mathworks.com. Warning: Name is nonexistent or not a directory:&lt;br&gt;
/matlab. &amp;gt; In path at 110 In startup at 4 In matlabrc at 272 Warning: Name&lt;br&gt;
is nonexistent or not a directory: /toolbox. &amp;gt; In path at 110 In startup at&lt;br&gt;
15 In matlabrc at 272 &amp;gt;&amp;gt; ans = 6 &amp;gt;&amp;gt;&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; But I don't want the message and prompt in the result variable. So is&lt;br&gt;
there any way to make result just store 6, e.e. &lt;br&gt;
&amp;gt; $ echo $result&lt;br&gt;
&amp;gt; 6&lt;br&gt;
&amp;gt; &lt;br&gt;
&lt;br&gt;
There are many ways.  I am sure plenty are tidier than this one:&lt;br&gt;
&lt;br&gt;
cow-lx 15% bash&lt;br&gt;
bash-2.05b$ result=$(echo &quot;disp(sprintf('\\n%0.6g',3+3)),quit&quot; \&lt;br&gt;
&amp;gt; | matlab -nodisplay -nojvm | tail -1)&lt;br&gt;
bash-2.05b$ echo $result&lt;br&gt;
6&lt;br&gt;
bash-2.05b$ exit&lt;br&gt;
exit&lt;br&gt;
cow-lx 16%&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Note that the backslash is to continue the command onto the next line, and&lt;br&gt;
that the &amp;gt; on the next line is the prompt for me to continue.&lt;br&gt;
&lt;br&gt;
I used disp(sprintf()) to get the answer on a line by itself. &lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
-- &lt;br&gt;
Dr Tristram J. Scott               &lt;br&gt;
Energy Consultant                  </description>
    </item>
  </channel>
</rss>

