function [x, xbar] = plscent(x)
% PLSCENT  Mean centers data in absorbance or concentration matrix.
%
%  [a, b] = plscent(c) 
%
%  where:
%
%    a = mean centered data
%    b = mean for each variable 
%

% Copyright (c) 1989-92 by The MathWorks, Inc.

[i, j] = size(x);
x = x';
xbar = mean(x);
for h = 1:i
	x(:,h) = x(:,h) - xbar(h);
end
x = x';
xbar = xbar';
