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 commentaire

Jan
Jan le 10 Déc 2020
Modifié(e) : Jan le 10 Déc 2020
Please post, what you have done so far. Then it is easier to add the needed code.

Connectez-vous pour commenter.

Réponses (2)

Walter Roberson
Walter Roberson le 10 Déc 2020

0 votes

s(i,t) = s(i, t-1) + q(i,t) - d(i,t)
Jan
Jan le 10 Déc 2020

0 votes

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

Catégories

En savoir plus sur Loops and Conditional Statements dans Centre d'aide et File Exchange

Question posée :

le 10 Déc 2020

Commenté :

le 10 Déc 2020

Community Treasure Hunt

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

Start Hunting!

Translated by