필터 지우기
필터 지우기

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

조회 수: 1 (최근 30일)
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);

채택된 답변

N/A
N/A 2018년 12월 2일
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.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by