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)

1 件のコメント

Kevin
Kevin 2020 年 12 月 10 日
Thanks, brother!

サインインしてコメントする。

Jan
Jan 2020 年 12 月 10 日

0 投票

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

1 件のコメント

Kevin
Kevin 2020 年 12 月 10 日
Thanks,sir!

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeLoops 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