登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
变量freq降水次数,在写入nc程序后在画图时总出现反向问题,使用过rot90和flipud都不行,想要问一下有没有人能帮助解决一下这个问题。
以下是出现的问题和代码。
clear all; clc
data = csvread('/Users/Downloads/freq/19791.csv');
%% 1′′½¨ncÎļt % cid = netcdf.create(filename, mode) % mode£o % 'NC_NOCLOBBER'£o Prevent overwriting of existing file with the same name. % 'NC_SHARE'£o Allow synchronous file updates. % 'NC_64BIT_OFFSET'£o Allow easier creation of files and variables which are larger than two gigabytes.
ncid1 = netcdf.create(['/Users/Downloads/thefile2.nc'],'NC_WRITE');
%% 2¶¨òåDimension % dimid = netcdf.defDim(ncid,dimname,dimlen)
dimidx = netcdf.defDim(ncid1,'lon',720); dimidy = netcdf.defDim(ncid1,'lat',360);
%% 3.¶¨òå±äá¿£o % varid = netcdf.defVar(ncid,varname,xtype,dimids) varid1 = netcdf.defVar(ncid1,'freq','double',[dimidx dimidy]); varid2 = netcdf.defVar(ncid1,'lon','double',[dimidx]); varid3 = netcdf.defVar(ncid1,'lat','double',[dimidy]);
%% 4 íê3énetCDFÎļt¶¨òåÄ£ê½ netcdf.endDef(ncid1);
lon=[0.25:0.5:359.75]; lat=[-89.75:0.5:89.75];
%% 5 °Ñêy¾YD′μ½netcdfμÄÎļtÖD % netcdf.putVar(ncid,varid,data) % netcdf.putVar(ncid,varid,start,data) % netcdf.putVar(ncid,varid,start,count,data) % netcdf.putVar(ncid,varid,start,count,stride,data) netcdf.putVar(ncid1,varid1,data); netcdf.putVar(ncid1,varid2,lon); netcdf.putVar(ncid1,varid3,lat);
%% 6 1رÕÎļt netcdf.close(ncid1);
|