function [x, xssq] = plsnorm(x)
% PLSNORM  Normalize data in absorbance or concentration matrix.
% Copyright (c) 1989-92 by The MathWorks, Inc.
%
%  [a, b] = plsnorm(c) 
%
%  where:
%
%   a = normalized data
%   b = variable root sum of squares
%
[tt1, tt2] = size(x);
x = x';
xssq = sqrt(sum(x .* x));
for h = 1:tt1
	x(:,h) = x(:,h) ./ xssq(h);
end
x = x';
xssq = xssq';
