Re: table (matrix) of strings



"xemi" <bartekborowicz@xxxxxxxxx> wrote in message
news:ef2d490.1@xxxxxxxxxxxxxxxxxxx
Steven Lord wrote:


Use a cell array. Search the documentation for "cell array" if
you're not
sure how to use them.

--
Steve Lord
slord@xxxxxxxxxxxxx




thx, but i have next question: how to convert from class cell to
string?:> sth similar to 'cell2mat' but for strings

Strings can be the contents of cells--cells are like containers in c++

To access cell 2 by itself... s(2).

To acces the contents of cell three... s{2} (Note the curly braces)

The contents of a cell that contains a string can be treated like any other
string.

For example...

s{1} = 'this '

s =

'this '

s{2} = 'is a string'

s =

'this ' 'is a string'

s

s =

'this ' 'is a string'

s(1)

ans =

'this '

s(2)

ans =

'is a string'

s{1}

ans =

this

s{2}

ans =

is a string

[s{:}]

ans =

this is a string


.