happy 发表于 2015-10-16 08:35

matlab中关于nc文件的一些主要命令

------------------------------------------------------------------------------------------------------------------
1、File Function文件操作
   (1). netcdf.open: open netCDF source.
      ncid = netcdf.open(filename, mode)
      parameter: 'WRITE' for read-write access, 'SHARE' for synchronous(同时) file updates, or 'NOWRITE' for read-only access.
(2). netcdf.inq: Return information about netCDF file.
   =netcdf.inq(ncid)
      ndims: number of dimensions
      nvars: number of variables
      ngatts: number of global attributes   'nglobalatts'
   unlimdimid: identity of the unlimited dimension
(3). netcdf.close: Close netCDF file.
       netcdf.close(ncid)
--------------------------------------------------------------------------------------
2、dimension functions维数
   netcdf.inqDim: Return netCDF dimension name and length.   
= netcdf.inqDim(ncid,dimid)
   dimd: dimension ID
--------------------------------------------------------------------------------------
3、Variable Functions变量
(1). netcdf.inqVarID: Return ID associated with variable name.
    varid = netcdf.inqVarID(ncid,varname)
(2). netcdf.getVar: Return data from netCDF variable.
   data = netcdf.getVar(ncid,varid)
   data = netcdf.getVar(ncid,varid,start)
   data = netcdf.getVar(ncid,varid,start,count)
   data = netcdf.getVar(ncid,varid,start,count,stride)
(3). netcdf.inqVar: Return information about netCDF variable.
    = netcdf.inqVar(ncid,varid)
   dimids: dimensions IDs,
   natts: the number of attributes ofthe variable identified by varid.
--------------------------------------------------------------------------------------
4、Attribute Functions变量属性
(1). netcdf.inqAttName: Return name of netCDF attribute.
   attname = netcdf.inqAttName(ncid,varid,attnum) returns the name of an attribute given the attribute number.(从Variable Functions(3)中可知道)
(2). netcdf.getAtt: Return netCDF attribute.
    attrvalue = netcdf.getAtt(ncid,varid,attname)
(3). netcdf.inqAtt:Return information about netCDF attribute.
    = netcdf.inqAtt(ncid,varid,attname)
--------------------------------------------------------------------------------------
----the--end---

转自:http://blog.sina.com.cn/u/66678321
页: [1]
查看完整版本: matlab中关于nc文件的一些主要命令