【matlab程序】画海洋流场
clear;clc;
file =( ‘0227.nc’);
lat=ncread(file,‘latitude’);
lon=ncread(file,‘longitude’);
u=ncread(file,‘water_u’);
v=ncread(file,‘water_v’);
[x,y]=meshgrid(lon,lat);
x=x’; y=y’;
interval=4;
figure (1)
set(gcf,‘color’,[1 1 1])
set(gcf,‘position’,[150 300 500 500])
set(0,‘defaultfigurecolor’,‘w’)
m_proj(‘Miller’,‘lon’,[lon(1) lon(end)],‘lat’,[lat(1) lat(end)]);
m_gshhs_i(‘patch’,[0.6 0.6 0.6],‘edgecolor’,‘k’);
m_grid(‘linest’,‘-.’,‘color’,‘k’);
hold on
m_quiver(x(1:interval:end,1:interval:end),y(1:interval:end,1:interval:end),u(1:interval:end,1:interval:end),v(1:interval:end,1:interval:end),0,‘k’);
title(‘海洋流场’)
print(‘-djpeg’,‘-r400’,[‘海洋流场.jpg’]);