概述
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5
function Red=mm_Red(data)%盲目约简算法,返回值为约简结果
[data_c,data_r]=size(data);
Red=data;
Red(data_c+1,data_r)=0;
[ind_data_num,ind_data_r]=size(myind(data));
[ind_Red_num,ind_Red_r]=size(myind(Red));
[Red_c,Red_r]=size(Red);
while((norm(Red(data_c+1),:)-ones(1,Red_r))~=0)
a=randint(1,1,[1,Red_r]);
if(Red(data_c+1,a)==0)
c=Red;
Red(:,a)=[];
[ind_Red_num,ind_Red_r]=size(myind(Red(1:data_c,:)));
if(ind_data_num==ind_Red_num)
[Red_c,Red_r]=size(Red);
else
Red=c;
Red(data_c+1,a)=1;
[Red_c,Red_r]=size(Red);
end
end
end
Red=Red(1:data_c,:);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function C=myind(a)%求划分函数
b=a;
c=intersect(a,b,'rows');
[m,n]=size(c);
[p,q]=size(a);
%C=[];
C={};
for i=1:m
z=c(i,:);
A=[];
for j=1:p
x=a(j,:);
if(ismember(z,x,'rows')==1)
A=[A j];
end
%C(i,1:length(A))=A;
C{i,1}=A;
end
end
1.JPG
(16.58 KB, 下载次数: 0)
2017-4-27 19:41 上传
最后
以上就是怕孤独海燕为你收集整理的matlab未定义sqrt,MATLAB编程运行出现“未定义函数或变量 "norm" ” 请问如何...的全部内容,希望文章能够帮你解决matlab未定义sqrt,MATLAB编程运行出现“未定义函数或变量 "norm" ” 请问如何...所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复