title: Matlab: Error using ==> mpower
body: <p>I'm trying to use <code>fsolve</code> in matlab to solve a system of nonlinear equations numerically. Here is a test sample of my program, <code>k1</code> and <code>R</code> are parameters and <code>x0</code> is the start point.</p>
  
  <pre><code>function y=f(k1, R, x0)
  
  pair=fsolve(@system,x0);
  
  y=pair(1);
  
      function r=system(v)
  
          int1=@(x) exp(k1*x);
          int2=@(x) exp(k1*x^2)/(x^4);
  
  
          r(1)=exp(v(1))*quadl(int1,0,v(1));     
          r(2)=exp(k1*v(2))*quadl(int2,v(1),20)*k1*R;
  
      end
  
  end
  </code></pre>
  
  <p>The strange thing is when I run this program, matlab keeps telling me that I should use <code>.^</code> instead of <code>^</code> in <code>int2=@(x) exp(k1*x^2)/(x^4)</code>. I am confused because the <code>x</code> in that function handle is supposed to be a scalar when it is used by <code>quadl</code>. Why should I have to use <code>.^</code> in this case?</p>
  
  <p>Also I see that a lot of the examples provided in online documentations also use <code>.^</code> even though they are clearly taking power of a scalar, as in <a href="http://www.mathworks.com/help/matlab/ref/quadl.html" rel="nofollow">here</a>. Can anybody help explain why?</p>
  
  <p>Thanks in advance.</p>