ischar
Tests whether a value is a character array.
Category: Language Fundamentals > Data Types
Syntax
tf = ischar(A)
Returns true for a char array.
Description
Single-quoted text such as 'abc' is a char array. A double-quoted "abc" is a string, so ischar is false for it; use isstring to test for strings, or ischar(x) || isstring(x) to accept both.
Input arguments
A- Any value.
Output arguments
tf- Logical scalar.
Example
Char vs string
ischar('abc')
ischar("abc")
ischar(65)
Output
ans = logical
1
ans = logical
0
ans = logical
0