Complete the code to create a string variable.
str = [1]('Hello');
In MATLAB, string creates a string array, which is different from a character array.
Complete the code to create a character array.
charArray = [1]('Hello');
The char function creates a character array in MATLAB.
Fix the error in the code to concatenate two strings properly.
result = [1] + " World";
+ causes an error.In MATLAB, string concatenation with + works only with string arrays, not character arrays.
Fill both blanks to create a character array and concatenate it with another.
a = [1]('Hi'); b = [2](' there'); result = [a b];
Character arrays are created with char and concatenated using square brackets [].
Fill all three blanks to create a string array, convert it to character array, and get its length.
str = [1]({'cat', 'dog'}); charArr = [2](str(1)); len = [3](charArr);
cellstr instead of string creates cell arrays, not string arrays.First create a string array with string, then convert the first element to a character array with char, and finally get its length with length.