title: Unable to Write Inline function in Matlab
body: <p>Unable to Write Inline Aggregate function in Matlab.
  X1, X2 are array variables. And mb and nb are size of BUS DATA.<br>
  V is the voltage function, delta is the angle.</p>
  
  <pre><code>% objf=inline('sum(V(mb)^2+V(nb)^2-2*V(mb)*V(nb)*cos(delta(mb)-delta(nb)))','mb','nb');
  % old code running 
  objf=inline('4*x1^2-2.1*x1^4+(x1^6)/3+x1*x2-4*x2^2+4*x2^4','x1','x2');**
  </code></pre>
  
  <p><strong>*Error using inlineeval (line 15)
  Error in inline expression ==> sum(V(mb).^2+V(nb).^2-2.*V(mb).*V(nb).<em>cos(delta(mb)-delta(nb)))
   Undefined function 'V' for input arguments of type 'double'.
  Error in inline/subsref (line 24)
      INLINE_OUT_ = inlineeval(INLINE_INPUTS_, INLINE_OBJ_.inputExpr, INLINE_OBJ_.expr);
  Error in deeee (line 48)
  fx=objf(x(:,1),x(:,2));</em></strong></p>
  
  <p><strong>where variable aer defined as below..</strong></p>
  
  <pre><code>busdata = bus; % ARRAY OF INPUTs
  j=sqrt(-1);
  P=[];Q=[];
  nb=busdata(:,1);
  kb=busdata(:,2);Vm=busdata(:,3);deltad=busdata(:, 4);Pd=0.8*busdata(:,5)/basemva;Qd=.8*busdata(:,6)/basemva;
  Pg=busdata(:,7)/basemva;Qg=busdata(:,8)/basemva;Bsh=busdata(:,11);Qmin=busdata(:,9)/basemva;Qmax=busdata(:,10)/basemva;
  G=real(Ybus);B=imag(Ybus);slb=find(kb==1);pv=find(kb==2);pq=find(kb==0);pvq=find(kb~=1);npv=length(pv);
  npq=length(pq);npvq=length(pvq);nbus=max(nb);
  delta(nb) = pi/180*deltad(nb);
  V(nb) = Vm(nb).*(cos(delta(nb))+j*sin(delta(nb)))';
  P(nb)=(Pg(nb)-Pd(nb));
  flag=0;   
  </code></pre>