Programming and Data Types | ![]() ![]() |
This chapter explains MATLAB's support for string data. It describes the two ways that MATLAB represents strings:
It also describes the operations that you can perform on string data under the following topics:
This table shows the string functions, which are located in the directory named strfun
in the MATLAB Toolbox.
Category |
Function |
Description |
General |
|
String of blanks |
|
Create cell array of strings from character array |
|
|
Create character array (string) |
|
|
Remove trailing blanks |
|
|
Execute string with MATLAB expression |
|
String Tests |
|
True for cell array of strings |
|
True for character array |
|
|
True for letters of alphabet. |
|
|
True for whitespace characters. |
|
String Operations |
|
Find one string within another |
|
Convert string to lowercase |
|
|
Concatenate strings |
|
|
Compare strings |
|
|
Compare strings, ignoring case |
|
|
Justify string |
|
|
Find matches for string |
|
|
Compare first N characters of strings |
|
|
Compare first N characters, ignoring case |
|
|
Replace string with another |
|
|
Find token in string |
|
|
Concatenate strings vertically |
|
|
Convert string to uppercase |
|
String to Number |
|
Convert string to numeric codes |
|
Convert integer to string |
|
|
Convert matrix to eval 'able string |
|
|
Convert number to string |
|
|
Write formatted data to string |
|
|
Convert string to double-precision value |
|
|
Form character matrix from strings |
|
|
Convert string to number |
|
|
Read string under format control |
|
Base Number Conversion |
|
Convert base B string to decimal integer |
|
Convert binary string to decimal integer |
|
|
Convert decimal integer to base B string |
|
|
Convert decimal integer to binary string |
|
|
Convert decimal integer to hexadecimal string |
|
|
Convert hexadecimal string to decimal integer |
|
|
Convert IEEE hexadecimal to double-precision number |
![]() | Making Efficient Use of Memory | Character Arrays | ![]() |