📄 information.asv
字号:
function [C]=Information()
%INFORMATION aims to simply the excel
%合并掉相同的行,得出简化的决策表,
%
clc;
clear;
syms x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 a1 a2 a3 a4 U;
L=[x1 2 1 3 1; x2 3 2 1 2
x3 2 1 3 1; x4 2 2 3 2
x5 1 1 4 1; x6 1 1 2 3
x7 3 2 1 2; x8 1 1 4 1
x9 2 1 3 1; x10 3 2 1 2];
X=[x1,x2,x3,x4,x5,x6,x7,x8,x9,x10];
% Infor(1).a1=2;
% Infor(1).a2=1;
% Infor(1).a3=3;
% Infor(1).a4=1;
%Classs(j) expreses the Properties of the information system etc: height
%size color
[m,n]=size(L);
Infor(1).Class={'U','a1','a2','a3','a4'};
% Infor(2).Class(1)={[];'x2';'x3';'x4';'x5';'x6';'x7';'x8';'x9';'x10'};
for i=1:m;
for j=1:n;
Infor(i+1).Class(j)=L(i,j);
end
end
Infor.Class;
fieldnames(Infor);
for i=1:m+1
Infor(i).Class;
end
Infor(2).Class(4);
C=Infor(2).Class;
Infor(4).Class;
%%
for a=3:11;
v=0;
[p,o]=size(C);
for i=1:p
w=0;
for j=2:o;
if((C(i,j))==(Infor(a).Class(j)))
;
else
w=w+1;
end
end
if(w~=0)
v=v+1;
else
;
end
end
if(v==p)
C=[C;Infor(a).Class];
else
;
end
end
[m,n]=size(C);
Infor1(1).Simply=Infor(1).Class;
for i=1:m
Infor1(i+1).Simply=C(i,:);
end
w={};
Infor1.Simply;
%决策表4--2的数据
% Diff(1).Pro=Infor1(1).Simply;
% for i=1:m
% Diff(i+1).Pro(1)=Infor1(i+1).Simply(1);
% end
% Diff.Pro;
%下面要解决的是从决策表到分辨矩阵的转化,
% a='';
% for i=2:m-1
% for j=i+1:m
% for p=2:n
% if((Infor1(i).Simply(p)~=Infor1(j).Simply(p))&(Infor1(i).Simply(n)==Infor1(j).Simply(n)))%查看决策属性是否相等,
% a=strcat(Infor1(1).Simply(p),
% end
%
%
% else
% ;
% end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -