gridMetadata.edit

Edit the metadata for a gridded dataset


Syntax



Description

obj = obj.edit(dimensions, metadata)

Replace the metadata for the named dimensions with the specified new metadata values. For grid dimensions, the new metadata should be a matrix with a supported data type, and cannot contain NaN or NaT elements. If the gridMetadata object has a set dimension order, and the defined dimensions change, also removes the dimension order from the object.

You may also include “attributes” in the dimension list to edit the non-dimensional attributes. If doing so, the metadata for the “attributes” entry should be a scalar struct, which can contain any fields and values.

obj = obj.edit(dimension1, metadata1, dimension2, metadata2, .., dimensionN, metadataN)
obj = obj.edit(…, ‘attributes’, attributes)

Uses a Name,Value syntax to edit the dimensions and/or non-dimensional attributes.


Input Arguments

dimensions

string vector [nDimensions]
The names of the dimensions whose metadata should be edited. May also include “attributes” in order to edit the non-dimensional attributes.

metadata

cell vector [nDimensions] {metadata matrix | scalar struct}
The new metadata values for each edited dimension. A cell vector with one element per edited dimension. Metadata for dimensions should follow the format specified for the “metadataN” input listed below. The new metadata for non-dimensional attributes should be a scalar struct, which may contain any fields or values.

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 values useful for the user.

Output Arguments

obj

gridMetadata object
The updated gridMetadata object.