資源簡介
利用matlab讀取水深數(shù)據(jù),然后繪制水深分布圖,分辨率為1分*1分。
代碼片段和文件信息
close?all;clear;clc
addpath?m_map
filename=‘D:\常用文件\異養(yǎng)細菌\進度\水深地形圖\ETOPO1_Ice_g_gmt4.grd‘;
ncdisp(filename);
%在這里設(shè)置畫圖區(qū)域的經(jīng)緯度
lat_min=10;??lat_max=25;
lon_min=105;?lon_max=122;
%設(shè)置水深坐標(biāo)軸(colorbar)的初始值和最大值
depth_min=-100;?depth_max=0;
%設(shè)置畫圖區(qū)域的起始水深線
depth_start=0;
%設(shè)置輸出圖像標(biāo)題
a=‘南海北部水深分布圖‘;
%度數(shù)轉(zhuǎn)換成像元個數(shù)來計算(注意這個為左下角坐標(biāo)系)
reslu=10800/180;
ilat_min=(90+lat_min)*reslu;
ilat_max=(90+lat_max)*reslu;
lat_step=ilat_max-ilat_min;
ilon_min=(180+lon_min)*reslu;
ilon_max=(180+lon_max)*reslu;
lon_step=ilon_max-ilon_min;
lat_depth=ncread(filename‘y‘ilat_minlat_step);
lon_depth=ncread(filename‘x‘ilon_minlon_step);
depth=ncread(filename‘z‘[ilon_min?ilat_min][lon_step?lat_step]);
depth(depth>depth_start)=NaN;
%save?lon_depth;
%save?lat_depth;
%save?depth;
figure
m_proj(‘mille
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2019-03-23?19:58??上傳網(wǎng)上\
?????文件????????2212??2019-03-19?21:13??上傳網(wǎng)上\ETOPO.m
?????文件??????302573??2019-03-23?19:57??上傳網(wǎng)上\水深分布圖.png
評論
共有 條評論