%% Determine if Array is Character Array
% Create different arrays, and then determine if they are character arrays.
% Test a character vector.

chr = 'Mary Jones'

%

tf = ischar(chr)

%
% Test a numeric array.

X = rand(1,3)

%

tf = ischar(X)

%
% Test a string array. Starting in R2017a, you can create strings using double quotes.

str = ["Smith","Chung","Morales"; ...
       "Sanchez","Peterson","Adams"]

%

tf = ischar(str)

% str is a string array, not a character array, so ischar returns 0.
% Copyright 2012 The MathWorks, Inc.