IRootLab
An Open-Source MATLAB toolbox for vibrational biospectroscopy
pre_sub_refmean.m
Go to the documentation of this file.
1 %> @brief Subtracts the mean of a reference class from all the rows
2 %>
3 %> @sa uip_pre_sub_refmean.m
4 classdef pre_sub_refmean < pre
5  properties
6  %> =1. Index of reference class (1-based = first class is class "1")
7  idx_refclass = 1;
8  end;
9 
10  methods
11  function o = pre_sub_refmean(o)
12  o.classtitle = 'Subtract mean of a reference class';
13  end;
14  end;
15 
16  methods(Access=protected)
17  function data = do_use(o, data)
18  me = mean(data.X(data.classes == (o.idx_refclass-1), :));
19 
20  data.X = data.X-repmat(me, data.no, 1);
21  end;
22  end;
23 end
Pre-processing block base class.
Definition: pre.m:2
Subtracts the mean of a reference class from all the rows.