⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 discrim.m

📁 该文件主要包括了matlab的一些主要应用例程!对学习matlab很有帮助
💻 M
字号:
iris1dat;
fid=fopen ( 'd:\ml\discr.txt','w');
newclass=classify(training,training,group);
fprintf(fid,'This is the result of verify        original  discrim\n');
[n,p]=size(training);
      for i=1:n;
   fprintf(fid,'%6.0f %6.1f %8.1f %8.1f %8.2f %8.0f %8.0f\n',i, training(i,1:4),group(i),newclass(i));
end;
%x=training(:,3)
%y=training(:,4)
%group
%plot(x,y,'+');
%hold on
%for i=1 : n;
%   a=group(i);
 %  string=['a'];
 %  text(x(i),y(i),string);
 %  end
%text(x,y,group);
fprintf(fid,'This is the new rusult\n');
newclass=classify(sample,training,group);
[n1,p]=size(sample);
      for i=1:n1;
   fprintf(fid,'%6.0f %6.1f %8.1f %8.1f %8.2f %6.0f\n',i,sample(i,1:4),newclass(i));
end;
fclose(fid);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -