MATLAB Programming Fundamentals - MathWorks
“Frequently Asked Questions About String Arrays” on page 6-66 See Also ...
Create Character Arrays Create Character Vector Create a character vector by enclosing a sequence of characters in single quotat ...
The char function converts the integer vector back to characters. chrAlpha = char([72 101 108 108 111 44 32 119 111 114 108 100] ...
mgrTitle = ['Harold A. Jorgensen '; ... 'Assistant Project Manager'; ... 'SFTware Corp. '] mgrTitle = 3×25 char array 'Harold A. ...
fullName = 'Thomas R. Lee, Sr. Developer, SFTware Corp.' Call the concatenation function, strcat. This method removes trailing ...
Work with Space Characters The blanks function creates a character vector of space characters. Create a vector of 15 space chara ...
chrTrim = 'AAAAA' Expand Character Arrays Generally, MathWorks does not recommend expanding the size of an existing character ar ...
Create String Arrays String arrays were introduced in R2016b. String arrays store pieces of text and provide a set of functions ...
Find the length of each string in str with the strlength function. Use strlength, not length, to determine the number of charact ...
Also, you can read text from files into string arrays using the readtable, textscan, and fscanf functions. Create Empty and Miss ...
You can create a string array with both empty and missing strings. Use the ismissing function to determine which elements are st ...
ans = 1x3 string array "Mercury" "Gemini" "Apollo" Access the second element in the second row of str. str(2,2) ans = "Skylab B" ...
Find the space characters in a string and replace them with dashes. Use the isspace function to inspect individual characters wi ...
str1 = str1'; str2 = str2'; str = [str1 str2]; str = [["Mission:","Station:"] ; str] str = 4x2 string array "Mission:" "Station: ...
Append a missing string. When you append a missing string with the plus operator, the output is a missing string. str1 = "Jones" ...
Join the last and first names. The join function places a space character between the strings it joins. After the join, names is ...
Cell Arrays of Character Vectors Convert to Cell Array of Character Vectors When you create character arrays from character vect ...
logical 1 Use char to convert back to a padded character array. chr = char(celldata) chr = 3×13 char array 'Allison Jones' 'Deve ...
Function Description ismember Detect members of a set. setdiff Return the set difference of two vectors. setxor Set the exclusiv ...
Analyze Text Data with String Arrays This example shows how to store text from a file as a string array, sort the words by their ...
«
6
7
8
9
10
11
12
13
14
15
»
Free download pdf