counting the correct interval and stop at the end of it

조회 수: 1 (최근 30일)
Gali Musa
Gali Musa 2018년 7월 21일
편집: KALYAN ACHARJYA 2018년 7월 30일
Pd = 480; inter = 18; Cap = 200; hrs = 8640; initial = Cap; yyyy(1) = initial; yyy(1) = 0;
for e_ref = Pd:Pd:hrs for t=1:inter
if Pd(Pd >= 72 & Pd < 120)
yyy(t+1) = ((-0.00005667*e_ref(t) + 100)/100);
yyyy(t+1) = yyy(t+1)*Cap;
e_ref(t+1) = e_ref(t) + Pd;
elseif Pd == 480
yyy(t+1) = ((-0.00008999*e_ref(t) + 100)/100);
yyyy(t+1) = yyy(t+1)*Cap;
e_ref(t+1) = e_ref(t) + Pd;
end
end
end
  댓글 수: 1
KALYAN ACHARJYA
KALYAN ACHARJYA 2018년 7월 21일
error in the code, pls provide the correct code, so that user help you easily.

댓글을 달려면 로그인하십시오.

답변 (1개)

KALYAN ACHARJYA
KALYAN ACHARJYA 2018년 7월 21일
%insert the following code within for loop, when Pd becomes 480, the loop execution stop
if Pd==480
return;
end
  댓글 수: 3
Gali Musa
Gali Musa 2018년 7월 21일
편집: Gali Musa 2018년 7월 21일
i have sorted out the problem..... Thank you
KALYAN ACHARJYA
KALYAN ACHARJYA 2018년 7월 30일
편집: KALYAN ACHARJYA 2018년 7월 30일
OK, Unable to a response you on time.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by