看看这段matlab哪里错了,提示如下,我做的是灰色预测Error using ==> vertcatCAT arguments dimensions are not consistent.Error in ==> Changjiang at 11E=[-C;ones(1,n-1)];原代码syms a b;c=[a b]';A=[158.626,171.636,202.812,218.826];B=cu

来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/23 10:00:23
看看这段matlab哪里错了,提示如下,我做的是灰色预测Errorusing==>vertcatCATargumentsdimensionsarenotconsistent.Errorin==>Cha

看看这段matlab哪里错了,提示如下,我做的是灰色预测Error using ==> vertcatCAT arguments dimensions are not consistent.Error in ==> Changjiang at 11E=[-C;ones(1,n-1)];原代码syms a b;c=[a b]';A=[158.626,171.636,202.812,218.826];B=cu
看看这段matlab哪里错了,提示如下,我做的是灰色预测
Error using ==> vertcat
CAT arguments dimensions are not consistent.
Error in ==> Changjiang at 11
E=[-C;ones(1,n-1)];
原代码
syms a b;
c=[a b]';
A=[158.626,171.636,202.812,218.826];
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+17)
F(i)=(A(1)-b/a)/exp(a*(i-1))+b/a;
end
G=[];G(1)=A(1);
for i=2:(n+17)
G(i)=F(i)-F(i-1);
end
t1=2000:2003;
t2=2000:2020;
G,a,b
plot(t1,A,'o',t2,G)

看看这段matlab哪里错了,提示如下,我做的是灰色预测Error using ==> vertcatCAT arguments dimensions are not consistent.Error in ==> Changjiang at 11E=[-C;ones(1,n-1)];原代码syms a b;c=[a b]';A=[158.626,171.636,202.812,218.826];B=cu
在我电脑上运行正常,2010a版本.