ncdisp - Display contents of netCDF data source in Command Window - MATLAB (original) (raw)

Display contents of netCDF data source in Command Window

Syntax

Description

ncdisp([source](#mw%5Fba91bde7-69c0-41bc-800b-a7200f28545c%5Fsep%5Fmw%5Fe339e1a9-285c-4606-9ca3-5d590980a4d2)) displays all groups, dimensions, variable definitions, and attributes in the specified netCDF data source as text in the Command Window.

example

ncdisp([source](#mw%5Fba91bde7-69c0-41bc-800b-a7200f28545c%5Fsep%5Fmw%5Fe339e1a9-285c-4606-9ca3-5d590980a4d2),[location](#mw%5Fa333ca1e-e799-4564-9198-e5c81a35bc92)) displays information about the variable or group specified bylocation.

example

ncdisp([source](#mw%5Fba91bde7-69c0-41bc-800b-a7200f28545c%5Fsep%5Fmw%5Fe339e1a9-285c-4606-9ca3-5d590980a4d2),[location](#mw%5Fa333ca1e-e799-4564-9198-e5c81a35bc92),[dispFormat](#mw%5Fb66a5bb6-f30d-47a2-9067-4e2a8faa6f11)) uses the display format specified by dispFormat.

example

Examples

collapse all

Display the contents of the netCDF fileexample.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 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);'

Display only the group hierarchy and variable definitions of the fileexample.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

collapse all

Name of the netCDF data source, specified as a string scalar or character vector. Thesource argument can be one of these values:

Example: "myNetCDFfile.nc"

Example: "http://_`hostname`_/_`netcdffilename`_#mode=bytes"

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, setlocation to "/" (forward slash).

Example: "myVar"

Example: "/myGrp/mySubGrp/myNestedVar"

Example: "myGrp"

Example: "/myGrp/mySubGrp"

Display format, specified as either "full" or"min". Set dispFormat to"full" to display attributes, and setdispFormat to "min" to suppress display of attributes.

Data Types: string | char

Tips

Version History

Introduced in R2011a

expand all

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.