|
|
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
用Matlab画三维地形图
W7 }! S' s6 S6 ], o: e: D, Z% C6 `
代码如下:( s" l/ o. a! }2 X$ A4 G
%%%%—————Code to draw 3D bathymetry——————————) `) o+ a- L3 b% T( T8 N# e
%-------Created by 猛牛,May 14,2012--------------------
; q# ?; t" M; N3 ]clear;clf;clc;
; t4 \- r+ G1 T: Lncload data_bathymetry.cdf
$ s9 M/ q/ O7 Pd_elev=elev(709:901,1441:1597); % Luzon Strait
* e) B- E1 r; I* Zlon=X(1441:1597);
+ D* D [9 \1 a4 Ilat=Y(709:901);1 M6 j/ f& h1 c5 o/ m* H7 B8 c
[xx,yy]=meshgrid(lon,lat);5 Z+ i( S$ o9 }5 L0 V
%---------------------------------------------3 m3 Z0 Y/ c8 }% ~2 I: V% M, s5 ?
view([10 -10 55])
2 t9 h$ ?" Z, n* z3 h# K0 |hold on! i) m4 L* I" t$ r' E
suRF(xx,yy,d_elev);
8 x! v8 g7 j2 t& B6 K7 I E/ Fshading interp# N9 t$ ]7 W/ Q! u, Q; ~( `
axis([120 135 14 31 -7000 900])2 s( J! @$ u4 e G) O% i! J+ D4 p
xlabel('Longitude','FontSize',16);& a c7 J2 l. z! z
ylabel('Latitude','FontSize',16);
U% i4 R) ~8 z7 Czlabel('Elevation(m)','FontSize',16);
3 T4 {, E- \+ `# m K8 n* p: O; c2 Gh=colorbar('v');
9 h3 A# q2 m) e2 I3 G3 Hcaxis([-7000 3000]);- Q/ v8 x; y' F6 v
set(get(h,'ylabel'),'string','Elevation(m)','fontsize',21);" J% |* F; D$ i" c/ Q7 n8 E
text(118,22,1000,'Taiwan Island','color','k','fontsize',16,'fontweight','bold');7 S* j: ~: x1 d# W/ x, X
text(118,19,0,'Luzon Strait','color','k','fontsize',16,'fontweight','bold');) b, n0 j& K5 e) s
text(118,16,100,'Luzon Island','color','k','fontsize',16,'fontweight','bold');
; F$ C& N: a0 q" d" \4 ntitle('Bathymetry of Luzon Strait','FontSize',31,'fontweight','bold');
0 j _/ i w5 l; U$ g |
|