Effacer les filtres
Effacer les filtres

I have the following m file andI am getting an "Index exceeds array bounds". I am trying to figure out why.

1 vue (au cours des 30 derniers jours)
The objective of this is todetermine the rate of change of temperature for 2881 timesteps. I am trying to run a for loop for each time step but I am getting an error saying that the index exceeds the array bounds.
Error in Shivam723 (line 164)
Tempchange1(i) = (a1*J_sun*Asun + e1*J_ear*Aearth -
e1*sigma*TPanel1(i-1)*Asat)/(satmass*sp_heat);

Réponse acceptée

N/A
N/A le 2 Déc 2018
I found the solution.
TPanel(1:6) was defined early on.
The issue was that while the initial TPanel(i-1) value was being assesed, the TPanel (i-1) wasn't being saved for the next iteration. Hence why it stopped after the first loop. Correcting this error, and a few other small ones made the code work as intended.

Plus de réponses (0)

Catégories

En savoir plus sur Matrix Indexing dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by