# handleCondition

## Syntax

[condmap, cond_value, cond_str] = handleCondition(condmap, cond)
DESCRIPTION
HANDLECONDITION is an internal function for performing extensive error
checking on condition arguments supplied to easy* functions. If a
supplied condition is not found in the condmap for the corresponding
condition factor, the condmap will be updated accordingly.
The condmap and cond arguments are both required with each call to
HANDLECONDITION. This function will assume that condmap is either a
valid table produced with makeMap, or a cell array of such tables. If
condmap is a cell array, it is assumed that the last element is a
master condmap of all condition permutations across multiple condition
factors as created by makeMap. The cond argument can either be a
numeric array, a string, or a cell array consisting of string, numeric,
or NaN elements. The number of elements in cond must be equal to the
number of condition factors in condmap.
USAGE
[map, cond_val, cond_str] = handleCondition(condmap, cond) takes a
condition map, condmap, and a condition, cond. It compares cond against
condmap for compatibility.
condmap: a table produced with makeMap, or a cell array of such tables
If condmap is a cell array, it is assumed that the last element
is a master condmap of all condition permutations across
multiple condition factors as created by makeMap.
cond: a numeric array, string, or cell array consisting of string,
numeric or NaN elements. The number of elements must be equal to
the number of condition factors in condmap.
OUTPUT
map: the initial condmap which may have additional entries when cond
was not found for a particular condition factor.
cond_val: a numeric representation of the input cond.
cond_str: a string representation of the input cond.