Main Content


Determine if input is string in Requirements Table block

Since R2022b



tf = isstring(X) returns 1 (true) if X is a string. Otherwise, it returns 0 (false). Use this operator in the Requirements Table block.


expand all

In a Requirements Table block, create two requirements that output if the string "Hello, world!" and the value 9 are strings.

y1 = isstring("Hello, world!")
y2 = isstring(9)

This image shows two requirements that check if an input is a string. Each requirement has a different input value.

Input Arguments

expand all

Input value, specified as a scalar, vector, matrix, or multidimensional array. X can be any data type. If X is a string, it must be a string scalar.

Version History

Introduced in R2022b

See Also