Main Content


Determine which characters are letters



tf = isletter(str) returns a Boolean array based on whether each character of str is a letter or not. Use this operator in the Requirements Table block.


expand all

In a Requirements Table block, create a requirement that outputs a logical array that indicates which characters in the string "Hello, world!" are letters.

y = isletter("Hello, world!")

This image shows a requirement that outputs a logical array by using a string "Hello, world!".

Input Arguments

expand all

Input string, specified as a string scalar. Enclose literal strings with double quotes.

Example: "Hello"

Data Types: string

Output Arguments

expand all

Whether each character is a letter, specified as a logical array. The elements in tf are logical 1 where the corresponding characters in str are letters, and logical 0 where the characters are not letters.


  • This operator does not support the use of Simulink.Bus object fields.

Version History

Introduced in R2022b

See Also