資源簡介
matlab代碼,用于高光譜、多光譜數(shù)據(jù)重采樣,內(nèi)容清晰

代碼片段和文件信息
%%輸入文件
clear?all
load?‘D:\工具\GER光譜數(shù)據(jù)_重采樣\all.txt‘;
[rowcol]?=?size(all);
band=all(:1);
all(:1)=[];?%%%%%%%%%%%%%%%%將第一列波長從矩陣中去掉
col=col-1;?%%%%%%%%%%%%%%%%矩陣的采樣點數(shù)目,即光譜曲線數(shù)目
%?newband=[400:1:750];
load?‘D:\工具\GER光譜數(shù)據(jù)_重采樣\newband.txt‘;
%%Piecewise?Cubic?Hermite?Interpolating?Polynomial?(PCHIP)內(nèi)插
for?point=1:col
????%point;
????spec=all(:point);
Interp_spec?=?pchip(bandspecnewband);?%%%%PCHIP既能保持光譜的形狀特征,又能夠不會過擬合,避免某些直線的部分?jǐn)M合成曲線。pchip(xyf)??x表示內(nèi)插前的x變量,y表示內(nèi)插前的y變量,f是內(nèi)插后的x變量。
Interp_Spec(:point)=Interp_spec;??????
end
%%輸出
plot(bandall(:1)‘o‘newbandInterp_Spec(:1)‘-.‘)
legend(‘data‘‘pchip‘4)
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????84924??2017-05-15?15:26??GER光譜數(shù)據(jù)_重采樣\all.txt
?????文件?????????748??2017-05-15?15:26??GER光譜數(shù)據(jù)_重采樣\Interpchip.m
?????文件????????3006??2017-05-15?15:26??GER光譜數(shù)據(jù)_重采樣\newband.txt
- 上一篇:差分方程的阻滯增長模型 matlab
- 下一篇:曲面擬合程序MATLAB
評論
共有 條評論