function rule=rulewithattr(condition,decision)
% to find all ruled hided in the decision system
% 鲁东大学张小峰编制,
% 为了保证本软件代码的共享性,如果您要修改,请注明修改日期和修改者,谢谢您的合作
% QQ:250129131 iamzxf@126.com
red=reductwithattrds(condition,decision);
reduced=condition(:,red);
[reduced,decision]=preprocess(reduced,decision);
[r,c]=size(reduced);
reduce=reduced;
for i=2:r
tempdec=decision(i,:);
j=c;
while j>=1
tempcon=reduced(i,:);
tempcon(1,j)=-1;
flat=1;% 预设标志位为1,如果不存在矛盾则为1,否则为0
for k=2:r
if (equal1(reduce(k,:),tempcon)==1) & (tempdec~=decision(k,:))
flat=0;
end
end
if flat==1
reduced(i,j)=-1;
end
j=j-1;
end
end
[reduced,decision]=preprocess(reduced,decision);
[c,r]=size(reduced);
[cd,rd]=size(decision);
% flat=1;%suppose there does not exist conflict
% for j=2:c
% if equal1(reduced(i,:),reduced(j,:))==1 & decision(i,:)~=decision(j,:)
% flat=0;
% end
% end
% if flat==1
l=0;
for i=2:c
k=0;
temp='';
for j=1:r
if reduced(i,j)~=-1
k=k+1;
if k==1
temp=strcat(temp,'a ',int2str(reduced(1,j)),'= ',int2str(reduced(i,j)));
else
temp=strcat(temp,' and ',' ',' a ',int2str(reduced(1,j)),' = ',int2str(reduced(i,j)));
end
end
end
decp='';
for j=1:rd
if j==1
decp=strcat(decp,' d ',int2str(decision(1,j)),' = ',int2str(decision(i,j)));
else
decp=strcat(decp,' and ',' ',' d ',int2str(decision(1,j)),' = ',int2str(decision(i,j)));
end
end
l=l+1;
rule=strcat(temp,' implies ',' ',decp)
end
end
没有合适的资源?快使用搜索试试~ 我知道了~
粗糙集详细matlab代码
共15个文件
m:15个
1星 需积分: 46 43 下载量 70 浏览量
2020-10-07
11:03:47
上传
评论 8
收藏 9KB ZIP 举报
温馨提示
粗糙集详细matlab代码粗糙集详细matlab代码粗糙集详细matlab代码粗糙集详细matlab代码粗糙集详细matlab代码粗糙集详细matlab代码
资源推荐
资源详情
资源评论
收起资源包目录
粗糙源码.zip (15个子文件)
corewithattrds.m 674B
subset11.m 562B
equal1.m 666B
preprocess.m 580B
elementin.m 449B
subset1m.m 506B
sort1.m 748B
poswithattr.m 698B
rulewithattr.m 2KB
indwithattr.m 674B
equalmatrix.m 693B
arraydelcr.m 1KB
reductwithattr.m 592B
columnzero.m 622B
reductwithattrds.m 706B
共 15 条
- 1
资源评论
- weixin_458923592021-07-16主函数都没有,怎么运行
zxh20085968
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功