stateVector.validateGrids
Check that gridfiles match values recorded for variables in a state vector
Syntax
Description
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.
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
header
string scalar
Header for returned error IDs
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