Looking to plot yaw motion of an aircraft but get "Array indices must be positive integers or logical values." Error

1 次查看(过去 30 天)
clear all
clc
N_phidot = -0.36752;
N_phi = -8.3569;
N_delta_r = -3.8313;
delta_R = -10;
sigma = 1/2.*N_phi;
omega_d = (-N_phi-1/4.*(-N_phidot)^2)^(1/2);
xi = 1/2.*(-N_phidot/-N_phi^(1/2));
omega_n = (-N_phi)^(1/2);
beta = (N_delta_r/N_phi).*delta_R;
phi = atan(sigma/omega_d);
alpha = -1/2.*beta.*(omega_n/omega_d);
Tau = 2*3.14/omega_d;
xiomega_n = 1/Tau;
t = [0:0.01:10];
Phi(t) = beta.*(1-(omega_n/omega_d.*exp(-sigma.*t).*cos((omega_d.*t)-phi)));
Phidot(t) = diff(Phi(t));
figure(1)
plot(t,phidot)
title('Phidot vs time')
xlabel('seconds')
ylabel('degrees')
figure(2)
plot(t, phi)
title('Phi vs time')
xlabel('seconds')
ylabel('degrees')
Error Messages
Array indices must be positive integers or logical values.
Error in HW1MAE503Q2 (line 22)
Phi(t) = beta.*(1-(omega_n/omega_d.*exp(-sigma.*t).*cos((omega_d.*t)-phi)));
>>

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Guidance, Navigation, and Control (GNC) 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by