matlab plot长度出错>> 程序在这里syms a b;c=[a b]';A=[13.0756,13.1448,
matlab plot长度出错
>> 程序在这里
syms a b;
c=[a b]';
A=[13.0756,13.1448,13.2129,13.2802,13.3474,13.7054,13.7440,13.7828,13.8216,13.8606];
B=cumsum(A);
n=length(A);
for i=1:(n-1)
C(i)=(B(i)+B(i+1))/2;
end
D=A;D(1)=[];
D=D';
E=[-C;ones(1,n-1)];
c=inv(E*E')*E*D;
c=c';
a=c(1);b=c(2);
F=[];F(1)=A(1);
for i=2:(n+10)
F(i)=(A(1)-b/a)/exp(a*(i-1))+b/a;
end
G=[];G(1)=A(1);
for i=2:(n+10)
G(i)=F(i)-F(i-1);
end
t1=2005:2014;
t2=2015:2024;
G;a,b
plot(t1,A,'o',t2,G)