dash.assert.scalarType

Throw error if input is not a scalar of a required data type


Syntax



Description

dash.assert.scalarType(input, types)

Checks if input is scalar and an allowed data type. If not, throws an error.

dash.assert.scalarType(input, types, name)

Uses a custom name for the input in error messages

dash.assert.scalarType(input, types, name, idHeader)

Uses a custom header for thrown error IDs.


Input Arguments

input

any data type
The input being tested

types

string vector | []
The allowed data types of the input. Use an empty array to not require a data type

name

string scalar
The name of the input in the calling function. Default is “input”

idHeader

string scalar
Header for thrown error IDs. Default is “DASH:assert:scalarType”