ncdisp
Display contents of netCDF data source in Command Window
Description
ncdisp(
displays all groups,
dimensions, variable definitions, and attributes in the specified netCDF data source as text
in the Command Window.source
)
ncdisp(
uses the display format specified by source
,location
,dispFormat
)dispFormat
.
Examples
Display Contents of NetCDF File
Display the contents of the netCDF file
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
Display Contents of NetCDF Variable
Display the contents of the variable peaks
in the
file example.nc
.
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);'
Hide Attributes from Displayed Contents
Display only the group hierarchy and variable definitions of the file
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
Input Arguments
source
— Name of netCDF data source
string scalar | character vector
Name of the netCDF data source, specified as a string scalar or character vector. The
source
argument can be one of these values:
The path of a local netCDF source
The OPeNDAP URL of a remote OPeNDAP netCDF data source
The HTTP URL of a remote netCDF source, with
#mode=bytes
appended to the end of the URL to enable byte-range readingNote
Byte-range reading is slower than other methods for reading from remote sources. For more details about byte-range reading, see the netCDF documentation.
Example: "myNetCDFfile.nc"
Example: "http://
host_name
/netcdf_filename
#mode=bytes"
location
— Location of variable or group
"/"
(default) | string scalar | character vector
Location of a variable or group in the netCDF data source, specified as a string
scalar or character vector. To display the contents of the entire source, set
location
to "/"
(forward slash).
Example: "myVar"
Example: "/myGrp/mySubGrp/myNestedVar"
Example: "myGrp"
Example: "/myGrp/mySubGrp"
dispFormat
— Display format
"full"
(default) | "min"
Display format, specified as either "full"
or
"min"
. Set dispFormat
to
"full"
to display attributes, and set
dispFormat
to "min"
to suppress display of
attributes.
Data Types: string
| char
Tips
If
source
is an OPeNDAP URL with a constraint expression, use the syntaxncdisp(source)
with no other input arguments.
Version History
Introduced in R2011aR2022a: Byte-range reading of remote datasets
You can use ncdisp
for read-only access to remote datasets using
the HTTP byte-range capability, provided that the remote server supports byte-range
access.
See Also
ncinfo
| ncread
| ncreadatt
| ncwrite
| ncwriteatt
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.
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)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)