⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 open.m

📁 MATLAB中读写、处理科学数据文件格式NETCDF的程序
💻 M
字号:
function theResult = open(self, thePermission)

% netcdf/open -- Open the file of a netcdf object.
%  open(self, 'thePermission') opens the NetCDF file
%   associated with self, a netcdf object, using
%   thePermission, either 'write' or 'nowrite' (default).
%   The object (self) is returned.  This routine can
%   be used to re-open a NetCDF file, using the
%   permission already established in self from a
%   previous invocation.

if nargin < 1, help(mfilename), return, end
if nargin < 2
   thePermission = self.itsPermission;
   if isempty(thePermission)
      thePermission = 'nowrite';
   end
end

[theNCid, status] = ncmex('open', name(self), thePermission);

if status >= 0
   w = which(name(self));
   if ~isempty(w), self = name(self, w); end
   self = ncid(self, theNCid);
   self.itsPermission = thePermission;
   self.itsDefineMode = 'data';
   [ndims, nvars, ngatts, theRecdimid, status] = ...
         ncmex('inquire', ncid(self));
   if status >= 0, self = recdimid(self, theRecdimid); end
   ncregister(self)
   self = ncregister(self);
end

result = self;

if nargout > 0, theResult = result; end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -