MATLAB Text Strings

MATLAB

Text Strings

Greg Reese, Ph.D

Research Computing Support Group

Academic Technology Services

Miami University

MATLAB

Text Strings

? 2010-2013 Greg Reese. All rights reserved

2

Content

Major sections

? Character arrays

? Formatted text

? String arrays

? Miscellaneous

3

Strings

MATLAB has two different types of text

strings ¨C character arrays and cell arrays

? Main internal difference is how stored in

memory

? User manipulates two types slightly

differently

Character arrays - best when considering

individual letters of text

Cell arrays - best when considering words

4

Character Arrays

Text stored in two-dimensional array

Key point ¨C All rows must have same

number of columns

? If not enough text in a row, row is

padded on right with blanks, i.e.,

MATLAB adds enough space

characters to end of text to make row

correct length

5

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download