matlab execute script from linux command line
<p>is there a way to run a matlab script from linux command line?
For instance, I have the following simple script "test.m":</p>

<pre><code>x = [1,2,3];
y = [2;3;4];

prod = x*y
disp(prod)
</code></pre>

<p>So what I want is to be able to execute that script from the linux command line without opening the matlab GUI or the matlab command line. That is, I expect something like that:</p>

<pre><code>~$ matlab test.m
</code></pre>

<p>and I expect to see the result of the product on the linux command line.</p>

<p>I know that you can do that with python e.g.,</p>

<pre><code>~$ python test.py
</code></pre>

<p>but was wondering if the same can be achieved with matlab. </p>