Info

This question is closed. Reopen it to edit or answer.

Error: Attempted to access recap(227,1); index must be a positive integer or logical.

1 view (last 30 days)
Hey, I got the above error on this code. What is strange is that it fills the array until it gets to 227, where it fails. I have no idea why. Any help is appreciated.
Umin = sqrt(Lift*2/(rho*CL*b*c));
recap = zeros (250,2);
Umin = round(Umin*10)/10;
recap(227,1) = 5;
for v = Umin:0.1:25
Lift = 0.5*rho*v^2*CL*b*c;
Drag = 0.5*rho*v^2*CD*b*c;
theta = atan((Lift-m*g)/Drag); %radians
num = v*10;
recap(num,1) = v;
recap(num,2) = theta;
end

Answers (1)

Image Analyst
Image Analyst on 24 Jan 2015

Community Treasure Hunt

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

Start Hunting!