dash.parse.inputOrCell
Parse inputs that are either cell vector of arrays, or a single array
Syntax
Description
Parses an input that can either be a cell vector of arrays, or a single array. If multiple array are required, ensures the input is a cell vector with the correct number of elements. If a single array is required and the input is an array, returns the array in a cell scalar. Also returns whether the input was a cell vector or direct array.
Customize thrown error messages and IDs.
Input Arguments
input
any data type
The input being tested
nEls
numeric scalar
The number of arrays required.
name
string scalar
A name to refer to the input in error messages. Default is “input”.
header
string scalar
Header for thrown error IDs. Default is “DASH:parse:inputOrCell”
Output Arguments
input
cell vector
The input array stored in a cell vector
wasCell
scalar logical
True if the input was a cell vector. Otherwise, false.