From: jens on
Hi Matlab users

I have a string like:

string=['test1', 'test2','test3']

I want to convert the string to a cellarray:

cellarray={'test1', 'test2','test3'}

Best Regards

Jens
From: Herve on

you are using here the concatenation syntax (see strcat in the help)
Therefore, string is equal to 'test1test2test3'
Use a string matrix ['test1'; 'test2';'test3'] and then cellstr to create a cell array.

H.
From: jens on
"Herve " <michaud_rene(a)yahoo.fr> wrote in message <ht5ovs$q8l$1(a)fred.mathworks.com>...
>
> you are using here the concatenation syntax (see strcat in the help)
> Therefore, string is equal to 'test1test2test3'
> Use a string matrix ['test1'; 'test2';'test3'] and then cellstr to create a cell array.
>
> H.

Thanks Herve

It works perfect

Best Regards

Jens