add two elements from diffrent matrices and store it into new matrix.

1 vue (au cours des 30 derniers jours)
Neel Patel
Neel Patel le 15 Déc 2020
Commenté : Neel Patel le 17 Déc 2020
my code is like this and i got error:
Index exceeds array bounds.
Error in line 3
QtA(t)=max(0,QtA(t-1)+LAMtA(t)-OtA(t)-LtA(t));
i just want to do arithmatic operation of diffrent elemtents of diffrent matrices and want to store it into a matrix as element. please help me. I am new at matlab.
i have matrices as shown in fig.
VtA(t)=max(0,N1-LAMtA(t-1)-LAMtA(t)+OtA(t));
VtD(t)=max(0,N2-LAMtD(t-1)-LAMtD(t)+OtD(t));
QtA(t)=max(0,QtA(tp-1)+LAMtA(t)-OtA(t)-LtA(t));
QtD(t)=max(0,QtD(tp-1)+LAMtD(t)-OtD(t)-LtD(t));

Réponse acceptée

VBBV
VBBV le 15 Déc 2020
Modifié(e) : VBBV le 15 Déc 2020
QtA(t)=max(0,QtA(tp)+LAMtA(t)-OtA(t)-LtA(t-1));
  3 commentaires
VBBV
VBBV le 15 Déc 2020
Modifié(e) : VBBV le 15 Déc 2020
Similarly LtA(t) are trying to access 2nd element which is not present, since t = 2
Neel Patel
Neel Patel le 17 Déc 2020
Thank you 🙂. I got it.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur General Applications dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by