gridMetadata.index

Return dimensional metadata at specified indices


Syntax



Description

obj = obj.index(dimensions, indices)

Returns a gridMetadata object in which the metadata along the specified dimensions corresponds to the metadata at the associated indices. Indices are for the rows of metadata in the original gridMetadata object.

obj = obj.index(dimension1, indices1, dimension2, indices2, .., dimensionN, indicesN)

Uses a Name,Value syntax to index dimensions.


Input Arguments

dimensions

string vector [nDims]
The names of the dimensions that should be indexed. Can only include dimensions that are defined in the gridMetadata object.

indices

cell vector [nDims] {vector, linear indices | logical vector [dimension length]}
The indices of metadata rows to return along the specified dimensions. Should be a cell vector with one cell per named dimension. Each cell holds a vector of indices for the associated dimension. Indices can either be a set of linear indices, or a logical vector the length of the dimension.

dimensionN

string scalar
The name of a dimension to index

indicesN

vector, linear indices | logical vector [dimension length]
The indices of the metadata rows to return along dimension N. Either a set of linear indices, or a logical vector the length of dimension N.

Output Arguments

obj

gridMetadata object
The updated metadata. Has the indexed rows of metadata along the input dimensions.