Indexing cannot yield multiple results matlab
이전 댓글 표시
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
end
function [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
end
end
[Edump,Eb,Ech] = charge(Pp,Pw,Phkt,Eb,Ebmax,uinv,Pl,t,Edump,Ech);
댓글 수: 2
Star Strider
2016년 12월 24일
What arguments (and their sizes and classes) are you passing to your ‘charge’ function?
Tahir Ibitoye
2017년 1월 5일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!