dash.assert.matrixTypeSize

Throw error if input is not a matrix of a specified format


Syntax



Description

dash.assert.matrixTypeSize(input, types, siz)

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

dash.assert.matrixTypeSize(input, types, siz, name, header)

Customize error messages and 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.

siz

vector, positive integers [2] | []
The required size of the matrix. The first element is required number of rows, and the second element is the required number of columns. Use NaN for an element to allow any size along that dimension, or use an empty array to allow any size.

name

string scalar
The name of the input for error messages. Default is “input”.