gridMetadata.assertField

Throw error if input is not a valid metadata field


Syntax



Description

meta = gridMetadata.assertField(meta, dim, idHeader)

Checks if meta is a valid metadata field. If not, throws an error with custom message and identifier. If so and the metadata is cellstring, returns the metadata as a string matrix.

Valid metadata fields are matrices of one of the following data type: numeric, logical, char, string, cellstring, or datetime. If numeric, the metadata cannot have NaN values. If datetime, the metadata cannot have NaT values.


Input Arguments

meta

any data type
The metadata input being tested

dim

string scalar
The name of the dimension associated with the metadata

idHeader

string scalar
Header for thrown error IDs

Output Arguments

meta

metadata matrix
The metadata field. If the input value was a cellstring data type, converts it to a string data type.