dash.assert.string
Throw error if input is not a string array, cellstring array, or character row vector
Syntax
Description
Checks if an input is either a string array, cellstring array, or char row vector. If not, throws an error. If so, returns the input as a string data type.
Customize message and header of thrown errors.
Input Arguments
input
any data type
The input being checked
name
string scalar
The name of the input in the calling function. Default is “input”.
header
string scalar
Header for thrown error IDs. Default is “DASH:assert:string”
Output Arguments
str
string array
The input converted to a string data type.