dash.assert.vectorTypeN

Throws error if input is not a vector of a specified format


Syntax



Description

dash.assert.vectorTypeN(input, types, length)

Checks if an input is a vector of the required data type and length. If not, throws an error

dash.assert.vectorTypeN(input, types, length, name)

Use a custom name to refer to the input in error messages.

dash.assert.vectorTypeN(input, types, length, name, idHeader)

Use 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 allow any type

length

scalar positive integer | [] | NaN
The required length of the vector. Use an empty array or NaN to allow any length

name

string scalar
The name of the input in the calling function for use in error messages. Default is “input”

idHeader

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