Code covered by the BSD License  

Highlights from
Mean centering spectrum

Mean centering spectrum

by

 

The process of mean-centering is to calculate the average spectrum of the data set and subtract that

mean_centering(Y,X)
function R = mean_centering(Y,X)
%Preprocessing multivariate data
%is applied by subtracting the mean spectrum of the data set from every
%spectra in the data set
% This function gives mean centering matrix and graph.
%Y must be n*n matrix
[n,m] = size(Y);
for i=1:n
    for j=1:m
        a(i)= mean(Y(i,:));
        R(i,j)= Y(i,j) - a(i);      
    end
end
plot(X,R);
disp(R);

Contact us