clc;
x=[];
y=[];
v=[];
zc=1938.9120;
x0=[
-250.7017667
-0.661133333
-14.95026667
14.8538
-0.949133333
1.499733333
-0.298733333
-23.13433333
23.0145
-0.840866667
1.2177
-29.89446667
28.55563333
0.4549
0.813366667
-1.1925
-0.328033333
45.5453
-44.1613
0.688933333
-1.811566667
-0.1179
1.595866667
0.305466667
-0.130866667
-0.622366667
0.391633333
0.2683
29.24478333
-29.48275
1.720426667
-1.082426667
0.417883333
-0.20083
0.325983333
-2.008303333
1.665356667
-0.029656667
-0.033933333
-14.7137
14.65116667
0.061066667
0.0988
-0.0502
-0.047366667
-0.316666667
0.682283333
-1.028483333
1.444026667
-0.725276667
0.057793333
-0.06561
-0.253933333
0.300273333
-0.097573333
0.049533333
-0.0002
-0.270866667
0.294403333
-0.296203333
0.457726667
-0.306926667
0.316576667
-0.191643333
-0.897633333
1.067856667
-1.157556667
1.528483333
-1.236983333
0.799513333
-0.052983333
-0.03322
0.574766667
-0.58688
-0.006896667
0.92759
-0.91903
-0.00856
-0.162433333
0.70105
-0.631616667
];
t=30/100:30/100:length(x0)/(100/30);
% t2=30/100:30/100:length(y0)/(100/30);
t=t';
[c2,gof2]=fit(t, x0, 'smoothingspline','SmoothingParam', 0.999987739835998);
% [c3,gof3]=fit(t2, z0, 'smoothingspline','SmoothingParam', 0.99999923);
% subplot(2,1,1)
plot(c2,'-b');
hold on ;
y0=0*t./t;
%
%
plot(t,y0,'--k');
legend('Actual angle','Reference angle');
xlabel('Time /s)');
ylabel('Yaw angle /°');
% subplot(2,1,2)
% plot(c3,t2,z0,'-r');
网友评论