Octave: invalid use of script in index expression
<p>I want to use a simple code (<code>plot.m</code>) in Octave to plot a figure. My code is the following:</p>

<pre class="lang-matlab prettyprint-override"><code>printf('Plotting Data...\n');
x = -10:0.1:10;
plot(x, sin(x));
</code></pre>

<p>But I get the error message:</p>

<blockquote>
  <p>error: invalid use of script  ex1/plot.m in index expression error: called from plot at line 3 column 1</p>
</blockquote>

<p>Could you tell me how to solve it? Thanks!</p>