ncdisp
在命令行窗口中显示 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_fahrenheit' 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
显示文件 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);'
只显示文件 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
输入参数
netCDF 数据源的名称,指定为字符串标量或字符向量。source
参量可以是以下值之一:
本地 netCDF 源的路径
远程 OPeNDAP netCDF 数据源的 OPeNDAP URL
远程 netCDF 源的 HTTP URL,在 URL 的末尾附加
#mode=bytes
以支持字节范围读取注意
字节范围读取比从远程数据源读取的其他方法要慢。有关字节范围读取的更多详细信息,请参阅 netCDF 文档。
示例: "myNetCDFfile.nc"
示例: "http://
host_name
/netcdf_filename
#mode=bytes"
netCDF 数据源中变量或组的位置,指定为字符串标量或字符向量。要显示整个数据源的内容,请将 location
设置为 "/"
(正斜杠)。
示例: "myVar"
示例: "/myGrp/mySubGrp/myNestedVar"
示例: "myGrp"
示例: "/myGrp/mySubGrp"
显示格式,指定为 "full"
或 "min"
。将 dispFormat
设置为 "full"
可显示属性,将 dispFormat
设置为 "min"
可取消属性的显示。
数据类型: string
| char
提示
如果
source
是带有约束表达式的 OPeNDAP URL,请使用ncdisp(source)
语法,不带任何其他输入参量。
版本历史记录
在 R2011a 中推出只要远程服务器支持字节范围访问,您就可以使用 ncdisp
通过 HTTP 字节范围功能对远程数据集进行只读访问。
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
- América Latina (Español)
- Canada (English)
- United States (English)
欧洲
- 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)