gridMetadata.gridMetadata
Creates a new gridMetadata object
Syntax
Description
Creates a metadata object for a gridded dataset.
obj = gridMetadata(…, ‘attributes’, attributes)
Include non-dimensional metadata attributes in the metadata object
Uses an alternate syntax to create a metadata object. In this syntax, collect all dimension names into a string vector, and corresponding metadata/attributes in a cell vector.
Creates a metadata object from a struct template. Fields of the struct that match dimension names or ‘attributes’ are copied as metadata.
Input Arguments
dimensionN
string scalar
The name of a dimension of a gridded dataset. Must be a recognized grid dimension. (See gridMetadata.dimensions for a list of available dimensions)
metadataN
matrix, numeric | logical | char | string | cellstring | datetime
The metadata for the dimension. Cannot have NaN or NaT elements.
attributes
scalar struct
Non-dimensional metadata attributes for a gridded dataset. May contain any fields or contents useful for the user.
dimensions
string vector [nDimensions]
The list of all dimensions to create in the metadata object. May also include the string “attributes” in order to create non-dimensional attributes.
metadata
cell vector [nDimensions] {metadata matrix | scalar struct}
The metadata for each dimension listed in the “dimensions” input. Each metadata value should follow the format described for the “metadataN” input above. Metadata for non-dimensional attributes should be a scalar struct, which may contain any fields or values.
s
scalar struct
A template for a gridMetadata object. May contain any fields, but fields that match dimension names or ‘attributes’ are copied as metadata for the new gridMetadata object.
Output Arguments
obj
gridMetadata object
The metadata object for a gridded dataset. The properties/fields of the object are the dimensions with metadata (dimN). Each field holds the associated metadata matrix (metaN). Cellstring metadata are converted to string.