本页面提供的是上一版软件的文档。当前版本中已删除对应的英文页面。
ncdisp
在命令行窗口中显示 NetCDF 数据源内容
说明
示例
显示 NetCDF 文件的内容
显示 NetCDF 文件示例 example.nc
的内容。
ncdisp('example.nc')
Source: matlabroot\toolbox\matlab\demos\example.nc Format: netcdf4 Global Attributes: creation_date = '29-Mar-2010' Dimensions: x = 50 y = 50 z = 5 Variables: avagadros_number Size: 1x1 Dimensions: Datatype: double Attributes: description = 'this variable has no dimensions' temperature Size: 50x1 Dimensions: x Datatype: int16 Attributes: scale_factor = 1.8 add_offset = 32 units = 'degrees_fahrenheight' peaks Size: 50x50 Dimensions: x,y Datatype: int16 Attributes: description = 'z = peaks(50);' Groups: /grid1/ Attributes: description = 'This is a group attribute.' Dimensions: x = 360 y = 180 time = 0 (UNLIMITED) Variables: temp Size: [] Dimensions: x,y,time Datatype: int16 /grid2/ Attributes: description = 'This is another group attribute.' Dimensions: x = 360 y = 180 time = 0 (UNLIMITED) Variables: temp Size: [] Dimensions: x,y,time Datatype: int16
MATLAB® 显示 example.nc
中的所有组、维度和变量定义。
显示 NetCDF 变量的内容
显示文件 example.nc
中变量 peaks
的内容。
ncdisp('example.nc','peaks')
Source: matlabroot\toolbox\matlab\demos\example.nc Format: netcdf4 Dimensions: x = 50 y = 50 Variables: peaks Size: 50x50 Dimensions: x,y Datatype: int16 Attributes: description = 'z = peaks(50);'
显示 NetCDF 文件内容并隐藏属性
只显示示例文件 example.nc
的组层次结构和变量定义。
ncdisp('example.nc','/','min')
Source: matlabroot\toolbox\matlab\demos\example.nc Format: netcdf4 Variables: avagadros_number Size: 1x1 Dimensions: Datatype: double temperature Size: 50x1 Dimensions: x Datatype: int16 peaks Size: 50x50 Dimensions: x,y Datatype: int16 Groups: /grid1/ Variables: temp Size: [] Dimensions: x,y,time Datatype: int16 /grid2/ Variables: temp Size: [] Dimensions: x,y,time Datatype: int16
输入参数
source
— NetCDF 数据源的名称
字符串标量 | 字符向量
NetCDF 数据源的名称,指定为字符串标量或字符向量。source
参数可以是以下值之一:
本地 NetCDF 源的路径
远程 OPeNDAP NetCDF 数据源的 OPeNDAP URL
远程 NetCDF 源的 HTTP URL,在 URL 的末尾附加
#mode=bytes
以支持字节范围读取注意
字节范围读取比从其他来源读取要慢。有关字节范围读取的更多详细信息,请参阅 NetCDF 文档。
示例: "myNetCDFfile.nc"
location
— 变量或组的位置
'/'
(默认) | 字符向量 | 字符串标量
NetCDF 文件中变量或组的位置,指定为字符向量或字符串标量。将 location
设置为 '/'
(正斜杠)可以显示文件所有内容。
数据类型: char
| string
dispFormat
— 显示格式
'full'
(默认) | 'min'
显示格式,指定为下列值之一。
'full' | 显示组层次结构并带有维度、属性和变量定义 |
'min' | 显示组层次结构和变量定义 |
数据类型: char
| string
局限性
字节范围读取的性能比从其他来源读取要慢。
提示
如果
source
是带有约束表达式的 OPeNDAP URL,请使用ncdisp(source)
语法,不带任何其他输入参数。
版本历史记录
在 R2011a 中推出R2022a: 远程数据集的字节范围读取
只要远程服务器支持字节范围访问,您就可以使用 ncdisp
通过 HTTP 字节范围功能对远程数据集进行只读访问。
MATLAB 命令
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)