|
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
用Matlab画三维地形图
K5 M2 ^8 h1 B4 `7 @( s! _
9 E6 J9 j& K7 Q4 u; g5 R! O代码如下:
# \( }5 V) e5 l& o0 R: A%%%%—————Code to draw 3D bathymetry——————————
# z/ s/ V w: Z%-------Created by 猛牛,May 14,2012--------------------7 g+ @2 O0 n/ }$ U/ F
clear;clf;clc;8 [0 Z2 v8 J1 o# w0 b: W \3 t2 e/ h
ncload data_bathymetry.cdf. Z* i5 T# q, ]4 L0 Q$ j( \
d_elev=elev(709:901,1441:1597); % Luzon Strait
. n3 ]' v* L& W* m L$ ylon=X(1441:1597);
6 H5 a9 y8 w# f: S/ p; Wlat=Y(709:901);1 |2 H7 z" e9 L& ^4 H& v) @+ w/ O
[xx,yy]=meshgrid(lon,lat);
) o* S F. a' b* i+ w4 `# C%---------------------------------------------
, {$ @7 i+ u5 i+ ~# ^4 \" z! h( [view([10 -10 55])
0 f3 ^ X# d2 t" ^/ H1 whold on5 I3 o" @2 u* U' Y+ T
suRF(xx,yy,d_elev);
, t U- u$ @% n6 E6 h( Qshading interp
; J. [0 ^. O5 Caxis([120 135 14 31 -7000 900])
9 }1 g) @9 y4 a0 |8 h/ l% Sxlabel('Longitude','FontSize',16);5 h2 r- i8 b% U$ j+ V
ylabel('Latitude','FontSize',16);
8 e+ o% S B+ ~: _4 }/ u) zzlabel('Elevation(m)','FontSize',16);
$ Q2 W- Z+ h. l2 @& Q1 I6 i6 bh=colorbar('v');
: r; R# F1 b, i. Q- Hcaxis([-7000 3000]);; \0 ?- i* T9 |7 A
set(get(h,'ylabel'),'string','Elevation(m)','fontsize',21);6 C+ ~8 g+ W, ]$ p3 M; W/ J$ Q) L
text(118,22,1000,'Taiwan Island','color','k','fontsize',16,'fontweight','bold');
6 ^! \. S8 o; A8 U8 U% g+ utext(118,19,0,'Luzon Strait','color','k','fontsize',16,'fontweight','bold');4 S. Y8 K) _! p9 p/ d2 ~9 G5 [0 J
text(118,16,100,'Luzon Island','color','k','fontsize',16,'fontweight','bold');/ {( {6 t7 o+ u, r( t: e
title('Bathymetry of Luzon Strait','FontSize',31,'fontweight','bold');" e6 N: |* _6 e. }
|
|