資源簡介
在matlab中采用四叉樹算法對讀取的二進制文件進行分割,去除NaN值之后對矩陣進行渲染繪圖。
代碼片段和文件信息
function?[]=picture(geodataifg)
%geodata=‘geodata.unw‘;
%ifg=‘ifg.rsc‘;
%讀取數(shù)據(jù)
listdata?=?importdata(geodata);
rscdata?=?importdata(ifg);
rscsj?=?rscdata.data;
rscname?=?rscdata.textdata;?
%計算坐標值
ifg?=?num2cell(rscsj);
struction?=?cell2struct(ifgrscname1);
xlast??=?double(struction.X_FIRST)?+?(double(struction.WIDTH)-1)*double(struction.X_STEP);
ylast??=?double(struction.Y_FIRST)?+?(double(struction.FILE_LENGTH)-1)*double(struction.Y_STEP);
x?=?[double(struction.X_FIRST)?xlast];
y?=?[double(struction.Y_FIRST)?ylast];
%畫圖
fid=?fopen(char(geodata)‘rb‘);
??????AS?=?fread(fid[double(struction.WIDTH)double(struction.FILE_LENGTH)]‘float‘);
??????fclose(fid);
??????AP=?AS‘;
??????%-------------------------四叉樹采樣----------------------------------
??????ASC=AP(345:
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2018-12-30?12:37??畫圖\
?????文件?????2064964??2017-03-27?15:58??畫圖\geodata.unw
?????文件?????????184??2017-03-27?15:58??畫圖\ifg.rsc
?????文件????????1471??2018-12-30?12:36??畫圖\picture.m
?????文件??????720896??2018-12-30?12:37??畫圖\rgb.txt
?????文件????????1207??2018-12-30?12:37??畫圖\Tree_4.m
評論
共有 條評論