下载此文档

读取和写入nc文件.docx


文档分类:办公文档 | 页数:约2页 举报非法文档有奖
1/2
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/2 下载此文档
文档列表 文档介绍
matlab读取和写入nc格式数据用到的几个函数(2013-04-19 11:39:01)转载▼
分类: Vapor
读取nc:
fname=’nc文件路径’。
(fname,'NC_NOWRITE');%打开文件
(fid,'varname');%返回各变量的id
(fid,vid);%根据ID读出数据
(fid);
例:
fname='F:\adcirc\tide\tide_OBC\four_tide\new_grd\huibao\27to29\'
(fname,'NC_NOWRITE');%´ò¿ªÎļþ
(fid,'lon');%·µ»Ø¸÷±äÁ¿µÄid
(fid,vid);%¸ù¾ÝID¶Á³öÊý¾Ý
(fid);
写入nc:
使用matlab原生支持命令创建nc文件范例

cid = (filename, mode);
mode:
'NC_NOCLOBBER': Prevent overwriting of existing file with the same name.
'NC_SHARE': Allow synchronous file updates.
'NC_64BIT_OFFSET': Allow easier creation of files and variables which are larger than two gigabytes.
例如:ncid = ('','NC_NOCLOBBER');

dimid = (ncid,dimname,dimlen);
例如:
dimidx = (ncid,'lon',10);
dimidy = (ncid,'lat',10);
3

读取和写入nc文件 来自淘豆网www.taodocs.com转载请标明出处.

非法内容举报中心
文档信息
  • 页数2
  • 收藏数0 收藏
  • 顶次数0
  • 上传人乘风破浪
  • 文件大小15 KB
  • 时间2018-10-30