Please Help me solve this loop!

Hello,
I am just student, I want to learn matlab more. But i get some trouble with loop
With t=1 i know how to code, however, Si(t-1) i don't know how to code, can you help me and teach me code for this loop , please ?

댓글 수: 1

Jan
Jan 2020년 12월 10일
편집: Jan 2020년 12월 10일
Please post, what you have done so far. Then it is easier to add the needed code.

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

답변 (2개)

Walter Roberson
Walter Roberson 2020년 12월 10일

0 개 추천

s(i,t) = s(i, t-1) + q(i,t) - d(i,t)
Jan
Jan 2020년 12월 10일

0 개 추천

You do not need a loop:
S = cumsum(q - d);

카테고리

도움말 센터File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

태그

질문:

2020년 12월 10일

댓글:

2020년 12월 10일

Community Treasure Hunt

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

Start Hunting!

Translated by