Attempted to access c(2); index out of bounds because numel(c)=1.

  • Follow


hi 
I'm student in korea and I don't understand "index out of bounds because numel(c)=1."

I'm needs your help

1) objetfunction  (variable x1,x2,x3)

function f= objet_cost21(x)
f=((100*x(1))-(5.81*x(1))+(50*x(1)))/20+ ((450*x(2))-(26.14*x(2))+(86*x(2)))/20+((500*x(3))+(200*x(3)))/20 ;

2) constraints 
function [c,ceq]= con_objet25(x)

% wind power
pw(1)=	2.412 	*x(1)	;
pw(2)=	0.512 	*x(1)	;
pw(3)=	1.321 	*x(1)	;
pw(4)=	1.079 	*x(1)	;
pw(5)=	3.538 	*x(1)	;
pw(6)=	3.538 	*x(1)	;
pw(7)=	3.609 	*x(1)	;
pw(8)=	4.621 	*x(1)	;
pw(9)=	4.055 	*x(1)	;
pw(10)=	4.706 	*x(1)	;
pw(11)=	4.212 	*x(1)	;
pw(12)=	3.828 	*x(1)	;
pw(13)=	5.055 	*x(1)	;
pw(14)=	3.538 	*x(1)	;
pw(15)=	3.263 	*x(1)	;
pw(16)=	2.524 	*x(1)	;
pw(17)=	2.638 	*x(1)	;
pw(18)=	3.330 	*x(1)	;
pw(19)=	3.681 	*x(1)	;
pw(20)=	2.940 	*x(1)	;
pw(21)=	2.468 	*x(1)	;
pw(22)=	2.000 	*x(1)	;
pw(23)=	1.905 	*x(1)	;
pw(24)=	1.680 	*x(1)	;

% solar power
ps(1)=	0.000 	*x(2)	;
ps(2)=	0.000 	*x(2)	;
ps(3)=	0.000 	*x(2)	;
ps(4)=	0.000 	*x(2)	;
ps(5)=	0.000 	*x(2)	;
ps(6)=	0.000 	*x(2)	;
ps(7)=	0.000 	*x(2)	;
ps(8)=	0.000 	*x(2)	;
ps(9)=	0.025 	*x(2)	;
ps(10)=	0.046 	*x(2)	;
ps(11)=	0.060 	*x(2)	;
ps(12)=	0.067 	*x(2)	;
ps(13)=	0.066 	*x(2)	;
ps(14)=	0.058 	*x(2)	;
ps(15)=	0.043 	*x(2)	;
ps(16)=	0.022 	*x(2)	;
ps(17)=	0.000 	*x(2)	;
ps(18)=	0.000 	*x(2)	;
ps(19)=	0.000 	*x(2)	;
ps(20)=	0.000 	*x(2)	;
ps(21)=	0.000 	*x(2)	;
ps(22)=	0.000 	*x(2)	;
ps(23)=	0.000 	*x(2)	;
ps(24)=	0.000 	*x(2)	;

% power demand 
pd(1)=	2716.920 	;
pd(2)=	2706.120 	;
pd(3)=	2746.800 	;
pd(4)=	2672.280 	;
pd(5)=	2696.400 	;
pd(6)=	2872.800 	;
pd(7)=	2708.640 	;
pd(8)=	2586.240 	;
pd(9)=	2556.720 	;
pd(10)=	2522.160 	;
pd(11)=	2493.000 	;
pd(12)=	2565.000 	;
pd(13)=	2561.760 	;
pd(14)=	2631.240 	;
pd(15)=	2729.520 	;
pd(16)=	2825.280 	;
pd(17)=	2961.720 	;
pd(18)=	3181.320 	;
pd(19)=	3155.040 	;
pd(20)=	3122.280 	;
pd(21)=	3058.200 	;
pd(22)=	3155.760 	;
pd(23)=	3097.440 	;
pd(24)=	3003.120 	;

% minimum permitted storage level
pbmin=3;

% soc
soc(1)=0;
soc(2)=soc(1);
soc(3)=soc(2);
soc(4)=soc(3);
soc(5)=soc(4);
soc(6)=soc(5);
soc(7)=soc(6);
soc(8)=soc(7);
soc(9)=soc(8);
soc(10)=soc(9);
soc(11)=soc(10);
soc(12)=soc(11);
soc(13)=soc(12);
soc(14)=soc(13);
soc(15)=soc(14);
soc(16)=soc(15);
soc(17)=soc(16);
soc(18)=soc(17);
soc(19)=soc(18);
soc(20)=soc(19);
soc(21)=soc(20);
soc(22)=soc(21);
soc(23)=soc(22);
soc(24)=soc(23);


for i=1:24; 
      a(i)= pw(i)+ps(i);           % total power
    b(i)= a(i)-pd(i);            % surpluse power
    c(i)= b(i)*0.82 ;            % charge
    d(i)= (c(i)-pbmin)/0.82 ;    % discharge
    
    
   if a(i) > pd(i) 
        
        t(i)=1;
        uu(i)=0;
        u(i)=1;
        
   else
        t(i)=0;
        uu(i)=1;
        u(i)=0;

    end 

% batter charge or discharge        
batchardis(1)=soc(1)+(c(1)*t(1))-	(d(1)*uu(1));
batchardis(2)=soc(2)+(c(2)*t(2))-	(d(2)*uu(2));
batchardis(3)=soc(3)+(c(3)*t(3))-	(d(3)*uu(3));
batchardis(4)=soc(4)+(c(4)*t(4))-	(d(4)*uu(4));
batchardis(5)=soc(5)+(c(5)*t(5))-	(d(5)*uu(5));
batchardis(6)=soc(6)+(c(6)*t(6))-	(d(6)*uu(6));
batchardis(7)=soc(7)+(c(7)*t(7))-	(d(7)*uu(7));
batchardis(8)=soc(8)+(c(8)*t(8))-	(d(8)*uu(8));
batchardis(9)=soc(9)+(c(9)*t(9))-	(d(9)*uu(9));
batchardis(10)=soc(10)+(c(10)*t(10))-(d(10)*uu(10));
batchardis(11)=soc(11)+(c(11)*t(11))-(d(11)*uu(11));
batchardis(12)=soc(12)+(c(12)*t(12))-(d(12)*uu(12));
batchardis(13)=soc(13)+(c(13)*t(13))-(d(13)*uu(13));
batchardis(14)=soc(14)+(c(14)*t(14))-(d(14)*uu(14));
batchardis(15)=soc(15)+(c(15)*t(15))-(d(15)*uu(15));
batchardis(16)=soc(16)+(c(16)*t(16))-(d(16)*uu(16));
batchardis(17)=soc(17)+(c(17)*t(17))-(d(17)*uu(17));
batchardis(18)=soc(18)+(c(18)*t(18))-(d(18)*uu(18));
batchardis(19)=soc(19)+(c(19)*t(19))-(d(19)*uu(19));
batchardis(20)=soc(20)+(c(20)*t(20))-(d(20)*uu(20));
batchardis(21)=soc(21)+(c(21)*t(21))-(d(21)*uu(21));
batchardis(22)=soc(22)+(c(22)*t(22))-(d(22)*uu(22));
batchardis(23)=soc(23)+(c(23)*t(23))-(d(23)*uu(23));
batchardis(24)=soc(24)+(c(24)*t(24))-(d(24)*uu(24));

% energy not serve
e(1)=(pbmin-(soc(1)+(c(1)*t(1)))-b(1))*u(1);
e(2)=(pbmin-(soc(2)+(c(2)*t(2)))-b(2))*u(2);
e(3)=(pbmin-(soc(3)+(c(3)*t(3)))-b(3))*u(3);
e(4)=(pbmin-(soc(4)+(c(4)*t(4)))-b(4))*u(4);
e(5)=(pbmin-(soc(5)+(c(5)*t(5)))-b(5))*u(5);
e(6)=(pbmin-(soc(6)+(c(6)*t(6)))-b(6))*u(6);
e(7)=(pbmin-(soc(7)+(c(7)*t(7)))-b(7))*u(7);
e(8)=(pbmin-(soc(8)+(c(8)*t(8)))-b(8))*u(8);
e(9)=(pbmin-(soc(9)+(c(9)*t(9)))-b(9))*u(9);
e(10)=(pbmin-(soc(10)+(c(10)*t(10)))-b(10))*u(10);
e(11)=(pbmin-(soc(11)+(c(11)*t(11)))-b(11))*u(11);
e(12)=(pbmin-(soc(12)+(c(12)*t(12)))-b(12))*u(12);
e(13)=(pbmin-(soc(13)+(c(13)*t(13)))-b(13))*u(13);
e(14)=(pbmin-(soc(14)+(c(14)*t(14)))-b(14))*u(14);
e(15)=(pbmin-(soc(15)+(c(15)*t(15)))-b(15))*u(15);
e(16)=(pbmin-(soc(16)+(c(16)*t(16)))-b(16))*u(16);
e(17)=(pbmin-(soc(17)+(c(17)*t(17)))-b(17))*u(17);
e(18)=(pbmin-(soc(18)+(c(18)*t(18)))-b(18))*u(18);
e(19)=(pbmin-(soc(19)+(c(19)*t(19)))-b(19))*u(19);
e(20)=(pbmin-(soc(20)+(c(20)*t(20)))-b(20))*u(20);
e(21)=(pbmin-(soc(21)+(c(21)*t(21)))-b(21))*u(21);
e(22)=(pbmin-(soc(22)+(c(22)*t(22)))-b(22))*u(22);
e(23)=(pbmin-(soc(23)+(c(23)*t(23)))-b(23))*u(23);
e(24)=(pbmin-(soc(24)+(c(24)*t(24)))-b(24))*u(24);


 end 



 for i= 1:24;
    
    if a(i)> pd(i)
        
       pb(i)=soc(i)+c(i);   % charge
        
        
    else
        
       pb(i)=soc(i)-((c(i)-pbmin)/0.82);  % discharge
        
        
    end
    
% constraints1
k(1)=-pw(1)-ps(1)-pb(1)+((1-(e(1)/67325.76))*pd(1));
k(2)=-pw(2)-ps(2)-pb(2)+((1-(e(2)/67325.76))*pd(1));
k(3)=-pw(3)-ps(3)-pb(3)+((1-(e(3)/67325.76))*pd(1));
k(4)=-pw(4)-ps(4)-pb(4)+((1-(e(4)/67325.76))*pd(1));
k(5)=-pw(5)-ps(5)-pb(5)+((1-(e(5)/67325.76))*pd(1));
k(6)=-pw(6)-ps(6)-pb(6)+((1-(e(6)/67325.76))*pd(1));
k(7)=-pw(7)-ps(7)-pb(7)+((1-(e(7)/67325.76))*pd(1));
k(8)=-pw(8)-ps(8)-pb(8)+((1-(e(8)/67325.76))*pd(1));
k(9)=-pw(9)-ps(9)-pb(9)+((1-(e(9)/67325.76))*pd(1));
k(10)=-pw(10)-ps(10)	-pb(10)+((1-(e(10)/67325.76))*pd());
k(11)=-pw(11)-ps(11)	-pb(11)+((1-(e(11)/67325.76))*pd(1));
k(12)=-pw(12)-ps(12)	-pb(12)+((1-(e(12)/67325.76))*pd(1))
k(13)=-pw(13)-ps(13)	-pb(13)+((1-(e(13)/67325.76))*pd(1));
k(14)=-pw(14)-ps(14)	-pb(14)+((1-(e(14)/67325.76))*pd(1));
k(15)=-pw(15)-ps(15)-pb(15)+((1-(e(15)/67325.76))*pd(1));
k(16)=-pw(16)-ps(16)	-pb(16)+((1-(e(16)/67325.76))*pd(1));
k(17)=-pw(17)-ps(17)	-pb(17)+((1-(e(17)/67325.76))*pd(1));
k(18)=-pw(18)-ps(18)	-pb(18)+((1-(e(18)/67325.76))*pd(1));
k(19)=-pw(19)-ps(19)	-pb(19)+((1-(e(19)/67325.76))*pd(1));
k(20)=-pw(20)-ps(20)	-pb(20)+((1-(e(20)/67325.76))*pd(1));
k(21)=-pw(21)-ps(21)	-pb(21)+((1-(e(21)/67325.76))*pd(1));
k(22)=-pw(22)-ps(22)	-pb(22)+((1-(e(22)/67325.76))*pd(1));
k(23)=-pw(23)-ps(23)	-pb(23)+((1-(e(23)/67325.76))*pd(1));
k(24)=-pw(24)-ps(24)	-pb(24)+((1-(e(24)/67325.76))*pd(1));


% constraints2
w(1)=(pw(1)+ps(1)+pb(1)-(pw(1)+ps(1)+soc(1)+c(1)-pd(1))-pd(1));
w(2)=(pw(2)+ps(2)+pb(2)-(pw(2)+ps(2)+soc(2)+c(2)-pd(2))-pd(2));
w(3)=(pw(3)+ps(3)+pb(3)-(pw(3)+ps(3)+soc(3)+c(3)-pd(3))-pd(3));
w(4)=(pw(4)+ps(4)+pb(4)-(pw(4)+ps(4)+soc(4)+c(4)-pd(4))-pd(4));
w(5)=(pw(5)+ps(5)+pb(5)-(pw(5)+ps(5)+soc(5)+c(5)-pd(5))-pd(5));
w(6)=(pw(6)+ps(6)+pb(6)-(pw(6)+ps(6)+soc(6)+c(6)-pd(6))-pd(6));
w(7)=(pw(7)+ps(7)+pb(7)-(pw(7)+ps(7)+soc(7)+c(7)-pd(7))-pd(7));
w(8)=(pw(8)+ps(8)+pb(8)-(pw(8)+ps(8)+soc(8)+c(8)-pd(8))-pd(8));
w(9)=(pw(9)+ps(9)+	pb(9)-(pw(9)+ps(9)+soc(9)+c(9)	-pd(9))-pd(9));
w(10)=(pw(10)+ps(10)+pb(10)-(pw(10)+ps(10)+soc(10)+c(10)-pd(10))-pd(10));
w(11)=(pw(11)+ps(11)+pb(11)-(pw(11)+ps(11)+soc(11)+c(11)-pd(11))-pd(11));
w(12)=(pw(12)+ps(12)+pb(12)-(pw(12)+ps(12)+soc(12)+c(12)-pd(12))-pd(12));
w(13)=(pw(13)+ps(13)+pb(13)-(pw(13)+ps(13)+soc(13)+c(13)-pd(13))-pd(13));
w(14)=(pw(14)+ps(14)+pb(14)-(pw(14)+ps(14)+soc(14)+c(14)-pd(14))-pd(14));
w(15)=(pw(15)+ps(15)+pb(15)-(pw(15)+ps(15)+soc(15)+c(15)-pd(15))-pd(15));
w(16)=(pw(16)+ps(16)+pb(16)-(pw(16)+ps(16)+soc(16)+c(16)-pd(16))-pd(16));
w(17)=(pw(17)+ps(17)+pb(17)-(pw(17)+ps(17)+soc(17)+c(17)-pd(17))-pd(17));
w(18)=(pw(18)+ps(18)+pb(18)-(pw(18)+ps(18)+soc(18)+c(18)-pd(18))-pd(18));
w(19)=(pw(19)+ps(19)+pb(19)-(pw(19)+ps(19)+soc(19)+c(19)-pd(19))-pd(19));
w(20)=(pw(20)+ps(20)+pb(20)-(pw(20)+ps(20)+soc(20)+c(20)-pd(20))-pd(20));
w(21)=(pw(21)+ps(21)+pb(21)-(pw(21)+ps(21)+soc(21)+c(21)-pd(21))-pd(21));
w(22)=(pw(22)+ps(22)+pb(22)-(pw(22)+ps(22)+soc(22)+c(22)-pd(22))-pd(22));
w(23)=(pw(23)+ps(23)+pb(23)-(pw(23)+ps(23)+soc(23)+c(23)-pd(23))-pd(23));
w(24)=(pw(24)+ps(24)+pb(24)-(pw(24)+ps(24)+soc(24)+c(24)-pd(24))-pd(24));



end 


c=[ pbmin-	soc(1);          % pbmin<= soc <= x3
    pbmin-	soc(2);
    pbmin-	soc(3);
    pbmin-	soc(4);
    pbmin-	soc(5);
    pbmin-	soc(6);
    pbmin-	soc(7);
    pbmin-	soc(8);
    pbmin-	soc(9);
    pbmin-	soc(10);
    pbmin-	soc(11);
    pbmin-	soc(12);
    pbmin-	soc(13);
    pbmin-	soc(14);
    pbmin-	soc(15);
    pbmin-	soc(16);
    pbmin-	soc(17);
    pbmin-	soc(18);
    pbmin-	soc(19);
    pbmin-	soc(20);
    pbmin-	soc(21);
    pbmin-	soc(22);
    pbmin-	soc(23);
    pbmin-	soc(24);
    
    soc(1)-x(3);
    soc(2)-x(3);
    soc(3)-x(3);
    soc(4)-x(3);
    soc(5)-x(3);
    soc(6)-x(3);
    soc(7)-x(3);
    soc(8)-x(3);
    soc(9)-x(3);
    soc(10)x(3);
    soc(11)-x(3);
    soc(12)-x(3);
    soc(13)-x(3);
    soc(14)-x(3);
    soc(15)-x(3);
    soc(16)-x(3);
    soc(17)-x(3);
    soc(18)-x(3);
    soc(19)-x(3);
    soc(20)-x(3);
    soc(21)-x(3);
    soc(22)-x(3);
    soc(23)-x(3);
    soc(24)-x(3);

    -pw(1)-ps(1)-pb(1)+((1-(e(1)/67325.76))*pd(1));
    -pw(2)-ps(2)-pb(2)+((1-(e(2)/67325.76))*pd(1));
    -pw(3)-ps(3)-pb(3)+((1-(e(3)/67325.76))*pd(1));
    -pw(4)-ps(4)-pb(4)+((1-(e(4)/67325.76))*pd(1));
    -pw(5)-ps(5)-pb(5)+((1-(e(5)/67325.76))*pd(1));
    -pw(6)-ps(6)-pb(6)+((1-(e(6)/67325.76))*pd(1));
    -pw(7)-ps(7)-pb(7)+((1-(e(7)/67325.76))*pd(1));
    -pw(8)-ps(8)-pb(8)+((1-(e(8)/67325.76))*pd(1));
    -pw(9)-ps(9)-pb(9)+((1-(e(9)/67325.76))*pd(1));
    -pw(10)	-ps(10)-pb(10)+((1-(e(10)/67325.76))*pd(1));
    -pw(11)	-ps(11)-pb(11)+((1-(e(11)/67325.76))*pd(1));
    -pw(12)	-ps(12)-pb(12)+((1-(e(12)/67325.76))*pd(1));
    -pw(13)	-ps(13)-pb(13)+((1-(e(13)/67325.76))*pd(1));
    -pw(14)	-ps(14)-pb(14)+((1-(e(14)/67325.76))*pd(1));
    -pw(15)	-ps(15)-pb(15)+((1-(e(15)/67325.76))*pd(1));
    -pw(16)	-ps(16)-pb(16)+((1-(e(16)/67325.76))*pd(1));
    -pw(17)	-ps(17)-pb(17)+((1-(e(17)/67325.76))*pd(1));
    -pw(18)	-ps(18)-pb(18)+((1-(e(18)/67325.76))*pd(1));
    -pw(19)	-ps(19)-pb(19)+((1-(e(19)/67325.76))*pd(1));
    -pw(20)	-ps(20)-pb(20)+((1-(e(20)/67325.76))*pd(1));
    -pw(21)	-ps(21)-pb(21)+((1-(e(21)/67325.76))*pd(1));
    -pw(22)	-ps(22)-pb(22)+((1-(e(22)/67325.76))*pd(1));
    -pw(23)	-ps(23)-pb(23)+((1-(e(23)/67325.76))*pd(1));
    -pw(24)	-ps(24)-pb(24)+((1-(e(24)/67325.76))*pd(1));
    
    (pw(1)+ps(1)+pb(1)-(pw(1)+ps(1)+soc(1)+c(1)-pd(1))-pd(1));
    (pw(2)+ps(2)+pb(2)-(pw(2)+ps(2)+soc(2)+c(2)-pd(2))-pd(2));
    (pw(3)+ps(3)+pb(3)-(pw(3)+ps(3)+soc(3)+c(3)-pd(3))-pd(3));
    (pw(4)+ps(4)+pb(4)-(pw(4)+ps(4)+soc(4)+c(4)-pd(4))-pd(4));
    (pw(5)+ps(5)+pb(5)-(pw(5)+ps(5)+soc(5)+c(5)-pd(5))-pd(5));
    (pw(6)+ps(6)+pb(6)-(pw(6)+ps(6)+soc(6)+c(6)-pd(6))-pd(6));
    (pw(7)+ps(7)+pb(7)-(pw(7)+ps(7)+soc(7)+c(7)-pd(7))-pd(7));
    (pw(8)+ps(8)+pb(8)-(pw(8)+ps(8)+soc(8)+c(8)-pd(8))-pd(8));
    (pw(9)ps(9)+pb(9)-(pw(9)+ps(9)+soc(9)+c(9)-pd(9))-pd(9));
    (pw(10)	+ps(10)+pb(10)-(pw(10)+ps(10)+soc(10)+c(10)-pd(10))	-pd(10));
    (pw(11)	+ps(11)+pb(11)-(pw(11)+ps(11)+soc(11)+c(11)-pd(11))	-pd(11));
    (pw(12)	+ps(12)+pb(12)-(pw(12)+ps(12)+soc(12)+c(12)-pd(12))	-pd(12));
    (pw(13)	+ps(13)+pb(13)-(pw(13)+ps(13)+soc(13)+c(13)-pd(13))	-pd(13));
    (pw(14)	+ps(14)+pb(14)-(pw(14)+ps(14)+soc(14)+c(14)-pd(14))	-pd(14));
    (pw(15)	+ps(15)+pb(15)-(pw(15)+ps(15)+soc(15)+c(15)-pd(15))	-pd(15));
    (pw(16)	+ps(16)+pb(16)-(pw(16)+ps(16)+soc(16)+c(16)-pd(16))	-pd(16));
    (pw(17)	+ps(17)+pb(17)-(pw(17)+ps(17)+soc(17)+c(17)-pd(17))-pd(17));
    (pw(18)	+ps(18)+pb(18)-(pw(18)+ps(18)+soc(18)+c(18)-pd(18))	-pd(18));
    (pw(19)	+ps(19)+pb(19)-(pw(19)+ps(19)+soc(19)+c(19)-pd(19))-pd(19));
    (pw(20)	+ps(20)+pb(20)-(pw(20)+ps(20)+soc(20)+c(20)-pd(20))	-pd(20));
    (pw(21)	+ps(21)+pb(21)-(pw(21)+ps(21)+soc(21)+c(21)-pd(21))-pd(21));
    (pw(22)	+ps(22)+pb(22)-(pw(22)+ps(22)+soc(22)+c(22)-pd(22))-pd(22));
    (pw(23)	+ps(23)+pb(23)-(pw(23)+ps(23)+soc(23)+c(23)-pd(23))	-pd(23));
    (pw(24)	+ps(24)+pb(24)-(pw(24)+ps(24)	+soc(24)+c(24)-pd(24))-pd(24));

    ];

ceq=[]; 




        400<=x1<=10000
       200<=x2<=8000
       0<=x3<=40

optimization toolbox operation 
bound lower [400;200;0]   
          upper[10000;8000;40]


but operation results 
Optimization running.
Attempted to access c(2); index out of bounds because numel(c)=1.


I'm needs your help 

thank you 
0
Reply chan 9/18/2010 8:38:05 PM

Really, but I say REALLY, read the first 4 chapters of the getting started guide...

And you don't define c before the first loop...

Oleg
0
Reply Oleg 9/18/2010 8:48:03 PM


"Oleg Komarov" <oleg.komarovRemove.this@hotmail.it> wrote in message <i738i3$eca$1@fred.mathworks.com>...
> Really, but I say REALLY, read the first 4 chapters of the getting started guide...
> 
> And you don't define c before the first loop...
> 
> Oleg


function f= objet_cost21(x) is operation 
but  function [c,ceq]= con_objet25(x) is not  operation 
and c= b(i)*0.82;
b(i) is defien pw(i)+ps(i)-pd(i)

I'm don't underatand 
thanks you
have a nice day!!
0
Reply chan 9/18/2010 8:58:03 PM

"chan young jung" <chanchan1982@nate.com> wrote in message <i7394r$kae$1@fred.mathworks.com>...
> "Oleg Komarov" <oleg.komarovRemove.this@hotmail.it> wrote in message <i738i3$eca$1@fred.mathworks.com>...
> > Really, but I say REALLY, read the first 4 chapters of the getting started guide...
> > 
> > And you don't define c before the first loop...
> > 
> > Oleg
> 
> 
> function f= objet_cost21(x) is operation 
> but  function [c,ceq]= con_objet25(x) is not  operation 
> and c= b(i)*0.82;
> b(i) is defien pw(i)+ps(i)-pd(i)
> 
> I'm don't underatand 
> thanks you
> have a nice day!!

Again, read the first 4 chapters of the getting started guide. You'll loose some time now but you'll end up saving a lot more later at least you won't copy paste lines just to use constants...

And in the function con_objet25(x), I don't find a line that defines "c".
You can't define "c" in workspace and expect the function to read it implicitly...the function reserves its own workspace (to cut it briefly).

Oleg
0
Reply Oleg 9/18/2010 11:01:04 PM

Ok, I found where you define "c".

Unfortunately I can't debug your code for you (for obvious reasons) but you can type in cmd win:
dbstop if error

then launch your script and when it errors the debugger will stop on the line that is giving the error.
Check the variables involved and see what's going wrong.
after you finish don't forget to type:
dbclear if error

For more details read the help on debugging.

Oleg
0
Reply Oleg 9/18/2010 11:05:04 PM

4 Replies
793 Views

(page loaded in 0.353 seconds)

Similiar Articles:









7/22/2012 9:14:53 AM


Reply: