Array indices must be positive integers or logical values.
Show older comments
Not really sure what I did wrong. I think it's my Rho list but I'm honestly unsure. Any input is greatly appreciated :)
C_L = 0.5;
C_D = 0.02;
L= 600; %lb
AR = 480; %ft^2
Alt = 12000; %ft
Angle_Climb = (C_D/C_L)*180/pi; %degrees
Rho =[0.00164779,0.00167423,0.00170099,0.00172808,0.00175549,0.00178324,0.00181132,0.00183974,0.00186850,0.00189760,0.00192704,0.00195684,0.00198698,0.00201748,0.00204834,0.00207956,0.00211114,0.00214308,0.00217539,0.00220808,0.00224114,0.00227457,0.00230839,0.00234259,0.00237717];
Rng = 0;
V_test = [];
V_y = [];
V_x = [];
t = [];
d=[];
for k=1:25
V = (2.*L./(Rho(k).*AR.*C_L)).^(1./2);
V_test(k) = V;
V_y(k) = V_test(k).*sin(0.04);
V_x(k) = V_test(k).*cos(0.04);
t(k) =500./V_y(k);
d(k) = V_x(k)./t(k);
end
display(V_test)
Accepted Answer
More Answers (0)
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!