stateVector.parseGrids

Parse inputs that are either gridfile objects or .grid file paths


Syntax



Description

[grids, failed, cause] = stateVector.parseGrids(grids, nVariables)

Parses gridfile inputs for a specified number of variables. If inputs are strings, returns the unique set of gridfile objects. If inputs are gridfile objects, updates the objects and returns them directly.

gridfile inputs may either be a scalar or a vector with one element per specified variable. Regardless of input type, the output parsed grids include “whichGrid” indices that specify which gridfile object should be used for each listed variable.

If any gridfile fails to build or update, records the failed gridfile and exits.

= stateVector.parseGrids(grids, nVariables, header)

Customize header in thrown error IDs.


Input Arguments

grids

any data type
The input being parsed. If valid, should be a string or gridfile scalar, or a vector with one element per variable.

nVariables

scalar positive integer
The number of variables that the gridfile input is for.

Output Arguments

grids

scalar struct
Organized set of gridfile objects

.gridfiles (gridfile vector [nGrids]): The gridfile objects

.whichGrid (vector, linear indices [nVariables]): The index of the gridfile object for each variable. Indices are on the interval 1:nGrids