title: MATLAB error message "This statement is not inside any function."
body: <p>I am trying to define a simple function and then call it:</p>
  
  <pre><code>   function p=MyExp(N);
        p=[ 1 ]; % 0th order polynomial. 
        for k=1:N
           pk=1/(factorial(k));
           p=[pk,1];
        end
     end
  
  
     poly3=MyExp(3);
     disp (poly3)
  </code></pre>
  
  <p>MATLAB is returning a message:
  Error: File: matlab_labIII_3_I.m Line: 10 Column: 1
  This statement is not inside any function.
   (It follows the END that terminates the definition of the function
   "MyExp".)</p>
  
  <p>This script works well on OCTAVE!</p>
  
  <p>Thanks</p>