title: Plot a function from other m file
body: <p>I'm working on numerical computation methods. I'm new to octave. I download two m files from the internet. Here I just gonna show you the problem-related code, not the whole code.</p>
  
  <blockquote>
    <p>From funct.m file:</p>
  </blockquote>
  
  <pre><code>function [ y ] = funct (x)
  y=(x*(exp((-x)+3)))-sin((7*x)-4)+(8*x)-20
  endfunction
  </code></pre>
  
  <p>I Think there is no problem there. The error occurred when I tried to plot the function in secant.m file. I've tried two kind of plotting functions. <code>plot()</code> and <code>fplot()</code></p>
  
  <blockquote>
    <p>secant.m file:</p>
  </blockquote>
  
  <p>1.plot():</p>
  
  <pre><code>x=linspace(0,10,20); 
  plot(x, funct(x));
  </code></pre>
  
  <p>The error message is <em>nonconformant arguments (op1 is 1x20, op2 is 1x20)</em></p>
  
  <p>2.fplot():</p>
  
  <pre><code>fplot(funct(x),[0,10],10)
  </code></pre>
  
  <p>The error message is <em>nonconformant arguments (op1 is 5x1, op2 is 5x1)</em></p>
  
  <p>How can I fix this error? I'm familiar with other programming language, especially C-like syntax, so feel free to answer it in technical way.</p>