stateVector.validateGrids

Check that gridfiles match values recorded for variables in a state vector


Syntax



Description

[failed, cause] = obj.validateGrids(grids, vars)

Checks if the provided gridfile objects match the gridfile parameters recorded for specified variables in a state vector. If not, returns the index of the first failed variable and reports the cause of the failure.

= obj.validateGrids(grids, vars, header)

Customize the header in returned error IDs.


Input Arguments

grids

scalar struct
Organizes a set of unique gridfile objects

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

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

vars

vector, linear indices [nVariables]
The index of the variables for the gridfile objects within the set of state vector variables

Output Arguments

failed

0 | scalar linear index
Set to 0 if the gridfile objects are all valid. If not, returns the state vector variable index of the first failed variable.

cause

scalar MException
The cause of the failed variable