i have my function like this;
when i run the the program it gives; Indexing cannot yield multiple results.Error in [Edump,Eb,Ech] = charge(Phkt,Pw,Pp,Ebmax,uinv,Pl,t,PchE,dump,Eb,Ech)
if true % code
endfunction [Edump,Eb,Ech] = charge(Phkt,Pw,Pp,Ebmax,uinv,Pl,t,PchE,dump,Eb,Ech)global Phkt Pw Pp Eb Ebmax uinv Pl t Ech % CHARGE
Pch(t)=( Pp(t)+Pw(t)+Phkt(t))-(Pl(t)/uinv); Ech(t)=Pch(t);%*1;%one hour iteration time
if Ech(t)<=Ebmax-Eb(t) Eb(t)=Eb(t-1)+Ech(t); if Eb(t)>Ebmax Eb(t)=Ebmax; Edump(t)=Ech(t)-(Ebmax-Eb(t)); else Edump(t)=0; end return else Eb(t)=Ebmax; Edump(t)=Ech(t)-(Ebmax-Eb(t)); return endend [Edump,Eb,Ech] = charge(Pp,Pw,Phkt,Eb,Ebmax,uinv,Pl,t,Edump,Ech);
Best Answer