This is machine translation

Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Translate This Page

MathWorks Machine Translation

The automated translation of this page is provided by a general purpose third party translator tool.

MathWorks does not warrant, and disclaims all liability for, the accuracy, suitability, or fitness for purpose of the translation.

ncwriteschema

Add NetCDF schema definitions to NetCDF file

Syntax

ncwriteschema(filename,schema)

Description

ncwriteschema(filename,schema) creates
or adds attributes, dimensions, variable definitions and group structure
defined in schema to the file filename.

Use ncwriteschema in combination with ncinfo to
create a new NetCDF file based on the schema of an existing file.
You can also use ncwriteschema to add variable
definitions, attributes, dimensions, or group structure to an existing
file.

Note:ncwriteschema does not write variable data.
Use ncwrite to write data to the created variables.
Created unlimited dimensions will have an initial size of 0 until
you write data.

Note:ncwriteschema cannot change the format of
an existing file. It cannot redefine existing variables and dimensions
in filename. If your schema contains attributes,
dimensions, variable definitions, or a group structure that already
exist in the file, writeschema issues a warning
but continues processing.

Input Arguments

filename

Text string specifying the name of a NetCDF file. If filename does
not exist, ncwriteschema creates a new file using
the netcdf4_classic format, unless the Format field
in schema specifies another format.

schema

A structure, or array of structures, representing either a dimension,
variable, an entire NetCDF file, or a netcdf4 group.
A group or file schema can contain a dimension or variable schema,
or both. You can use the output returned by ncinfo as
a schema structure. The following table lists the
fields in the various types of schema structures. Optional fields
are marked with asterisk (*).

Schema Type

Structure
Field

Description

Group/File Schema

Name

Text string identifying the group name. Use '/' to
indicate the entire file.

Create a netcdf4_classic format file to store
a single variable from an existing file. First use ncinfo to
get the schema of the peaks variable from the file. Then use ncwriteschema to
create a NetCDF file, defining the peaks variable. Use ncread to
get the data associated with the peaks variable and then use ncwrite to
write the data to the variable in the new NetCDF file.