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

📄 find_target.m

📁 模式识别工具箱,希望对大家有用!
💻 M
字号:
%FIND_TARGET extract the indices of the target and outlier objects
%
%   [I1,I2] = find_target(a)
%
% Give the indices of the objects labelled 'target' and 'outlier' in
% the index vectors I1 and I2 respectively.

% Copyright: D. Tax, R.P.W. Duin, davidt@ph.tn.tudelft.nl
% Faculty of Applied Physics, Delft University of Technology
% P.O. Box 5046, 2600 GA Delft, The Netherlands

function [I1,I2] = find_target(a)

if isa(a,'dataset')
  [l,lablist] = dataset(a);
else
  [l,lablist] = renumlab(a);
end

I1 = find(l == strmatch('target',lablist));
if isempty(I1)
   warning('Cannot find target objects in dataset.');
end
if (nargout>1)
   if isempty(strmatch('outlier',lablist))
     I2 = [];
   else 
     I2 = find(l == strmatch('outlier',lablist));
   end
%   if isempty(I2)
%      warning('Cannot find outlier objects in dataset.');
%   end
end

⌨️ 快捷键说明

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