📄 stdsslct.m
字号:
function [specsub,specnos] = stdsslct(spec,nosamps)
%STDSSLCT Selects subset of spectra for use in standardization
% Selects a subset of the given spectra based on leverage for
% use in developing transforms for instrument standardization.
% The inputs are the available spectra (spec) and the number
% samples to be selected (nosamps). The outputs are the matrix
% of spectra selected (specsub) and the sample numbers of the
% selected spectra (specnos). The I/O format is:
% [specsub,specnos] = stdsslct(spec,nosamps);
% Copyright
% Barry M. Wise
% 1994
[ms,ns] = size(spec);
r1 = mncn(spec);
subset = zeros(1,nosamps);
for i = 1:nosamps
hat = r1*r1';
[x subset(1,i)] = max(diag(hat));
r0 = r1(subset(1,i),:);
r1(subset(1,i),:) = zeros(1,ns);
for j = 1:ms
r1(j,:) = r1(j,:) - ((r0*r1(j,:)')/(r0*r0'))*r0;
end
end
disp('The subset selected consists of the following samples:')
disp(' ')
disp(subset)
specnos = subset;
specsub = spec(subset,:);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -