Index exceeds the number of array elements in a while loop
古いコメントを表示
Hello everyone, I keep getting the classic error message of 'Index exceeds the number of array elements (169)'. Here is my code, it's a very simple while loop:
syms T h
T (h) = ((288.19-0.00649.*h));
h = linspace (7620,11000,169); %Every step is 20m change in altitude
D = vpa(T(h),4);
s = 1;
while s <= 169
rho(s) = 1.225*(D(h)/288.19)^((9.80665/(0.0065*286))-1);
s = s+1;
end
I really don't see where I've gone wrong. I have other while loops that follow the same structure and they work perfectly. Any help would be appreciated. Thanks in advance!
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Matrix Indexing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!