if (str == "")
disp 'str has zero characters'
endstr has zero charactersDo not use the isempty function to test for empty strings. A string with zero characters
still has a size of 1-by-1. However, you can test if a string array has at least one dimension
with a size of zero using the isempty function.Create an empty string array using the strings function. To be an empty array, at least
one dimension must have a size of zero.str = strings(0,3)str =0x3 empty string arrayTest str using the isempty function.isempty(str)ans = logical
1Test a string array for empty strings. The == operator returns a logical array that is the
same size as the string array.str = ["Mercury","","Apollo"]str = 1x3 string array
"Mercury" "" "Apollo"str == ''ans = 1x3 logical array0 1 06 Characters and Strings