IRootLab
An Open-Source MATLAB toolbox for vibrational biospectroscopy
data_isolate_class.m
Go to the documentation of this file.
1 %>@ingroup datasettools
2 %> @file
3 %> @brief Isolates a particular class, so it will be class 0 and all the other will be class 1
4 function data = data_isolate_class(data, class)
5 
6  score_code = data.classlabels{class+1};
7  no_obs = data_get_size(data);
8 
9  for i = 1:no_obs
10  if data.classes(i) == class
11  data.classes(i) = 0;
12  else
13  data.classes(i) = 1;
14  end;
15  end;
16  data.classlabels = {score_code, 'All other classes'};
17 end;
function data_isolate_class(in data, in class)