dash.parse.inputOrCell

Parse inputs that are either cell vector of arrays, or a single array


Syntax



Description

[input, wasCell] = dash.parse.inputOrCell(input, nEls)

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.

= dash.parse.inputOrCell(input, nEls, name, header)

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”.

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.