早教吧 育儿知识 作业答案 考试题库 百科 知识分享

为什么我的灰色关联程序一直报错!m=2;k=35;X0=zeros(35,2);R0=zeros(35,2);a0=[110111.6114101.2107.2104.2115111.3110.1101.910194.8106.2102.1105.4117.1114.9105.7105.1107.8105.9107.8108.9108.5115.6111.2111.5111.211

题目详情
为什么我的灰色关联程序一直报错!
m=2;
k=35;
X0=zeros(35,2);
R0=zeros(35,2);
a0=[110 111.6 114 101.2 107.2 104.2 115 111.3 110.1 101.9 101 94.8 106.2 102.1 105.4 117.1 114.9 105.7 105.1 107.8 105.9 107.8 108.9 108.5 115.6 111.2 111.5 111.2 112.2 111.2 107 109.7 106.2 107.2 107.3];
a1=[100.6 101.8 106 101.3 101.8 100.5 102.2 117.6 106.8 108.6 120.4 117.2 105.4 111.9 109.9 119 124.9 117.3 111.6 105.3 102.4 100.6 103.5 103.1 98.2 100.2101 101.5 100.9 102.4 105.1 98.5 102.4 105.6 103.3];
a2=[110.5 109.7 111.8 99.5 107.4 116.4 117.4 108.7 108 109.6 112.8 104.4 105.2 109.9 111.3 112.3 113.7 112 109 110.1 109.5 110.9 111.8 111.7 111.5 111.1 114.1 112.1 113 114.5 109.1 110.2 110.3 108.1 107.7];
X=[a1' a2'];
for i=1:m
for ii=1:k
X0(ii,i)=abs(a0(ii)-X(ii,i));
end
end
Max=max(max(X0));
Min=min(min(X0));
for i=1:m
for ii=1:k
R0(ii,i)=(Min+0.5*Max)/(Min+0.5*Max+X0(ii,i));
end
end
r=sum(R0)/K;
disp('关联度依次为:')
disp(r)
▼优质解答
答案和解析
a1中有数据输入错误了!