爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 4730|回复: 4

[程序设计] 用m_contour绘制ssh,但出现error

[复制链接]

新浪微博达人勋

发表于 2016-4-8 22:33:54 | 显示全部楼层 |阅读模式

登录后查看更多精彩内容~

您需要 登录 才可以下载或查看,没有帐号?立即注册 新浪微博登陆

x
clc;
close all;clear;

mmap_path='C:\Users\youlin\Documents\MATLAB\matlab\m_map\';

%nc_path = 'D:\dt_global_twosat_madt_h_20000315_20140106.nc';
nc_path = 'H:\AVISO\AGC\two_sat_merged\h\2000\dt_global_twosat_madt_h_20000315_20140106.nc';


lon=[121 124];
lat=[24 27];

data=double(ncread(nc_path,'adt'));
lon=double(ncread(nc_path,'lon'));
lat=double(ncread(nc_path,'lat'));
time=double(ncread(nc_path,'time'));

data=data';
pdata=data(435:480,450:540);
%pdata(data>150)=nan;
pdata=pdata*100

[lon lat]=meshgrid(lon,lat);

figure;hold on;warning off;
m_proj('Equidistant cylindrical','lon',[121 124],'lat',[24 27]);
m_grid('linestyle','none','tickdir','out','linewidth',3);
[c h]=m_contour(lat,lon,pdata,5);
shading flat,colorbar
m_gshhs_i('patch',[.5 .5 .5]);


出现error
Error in m_contour (line 37)
data(i)=NaN;

Error in adt (line 29)
[c h]=m_contour(lat,lon,pdata,5);
哪里需要修改,谢谢!

密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2016-4-8 23:35:30 | 显示全部楼层
你这样提问是不对的
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2017-1-11 14:20:01 | 显示全部楼层
楼主解决了?我也是出现类似问题
m_contourf(lon1,lat1,x1);


??? Error using ==> contourf at 65
The size of X must match the size of Z or the number of
columns of Z.

Error in ==> m_contourf at 63
   [cs,h]=contourf(X,Y,data,varargin{:});

Error in ==> EOF at 29
m_contourf(lon1,lat1,x1);
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2017-1-12 00:05:34 | 显示全部楼层
Jeanela 发表于 2017-1-11 14:20
楼主解决了?我也是出现类似问题
m_contourf(lon1,lat1,x1);

后来使用,像这样
m_contourf(lon1,lat1,x1,10);
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2017-1-12 13:06:05 | 显示全部楼层
yes 发表于 2017-1-12 00:05
后来使用,像这样
m_contourf(lon1,lat1,x1,10);

好的,多谢
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

Copyright ©2011-2014 bbs.06climate.com All Rights Reserved.  Powered by Discuz! (京ICP-10201084)

本站信息均由会员发表,不代表气象家园立场,禁止在本站发表与国家法律相抵触言论

快速回复 返回顶部 返回列表