Wednesday, April 23, 2008

convert a cell array into a vector with strings

if you have a cell array into a vector with strings, you can use the following command:

my_cell = {'a','b'};
my_new_vector = [my_cell{1:end}];

5 comments:

Anonymous said...

thank you helped me with a program for homework in college.

Anonymous said...

A shorter version is:

my_new_vector = [my_cell{:}];

Anonymous said...

A shorter version is:

my_new_vector = [my_cell{:}];

Anonymous said...

A shorter version is:

my_new_vector = [my_cell{:}];

Anonymous said...

thank you very much. I was finding exactly this. Searched whole internet for proper matlab solutions but nothing worked until i came here