|
|
Convert comma separated string to cellarray
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
|
|
0
|
|
|
|
Reply
|
jens
|
5/21/2010 9:31:06 AM |
|
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.
|
|
0
|
|
|
|
Reply
|
Herve
|
5/21/2010 10:58:04 AM
|
|
"Herve " <michaud_rene@yahoo.fr> wrote in message <ht5ovs$q8l$1@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
|
|
0
|
|
|
|
Reply
|
jens
|
5/21/2010 12:50:20 PM
|
|
|
2 Replies
615 Views
(page loaded in 0.934 seconds)
Similiar Articles: Convert comma separated string to cellarray - comp.soft-sys.matlab ...Hi Matlab users I have a string like: string=['test1', 'test2','test3'] I want to convert the string to a cellarray: cellarray={'test1', ... Save CellArray as csv - comp.soft-sys.matlab... string - comp.lang.perl.misc When you save the Excel file as CSV, it only saves the significant digits, not leading zeros. ... Convert comma separated string to cellarray ... Convert all cell array to string - comp.soft-sys.matlabConvert comma separated string to cellarray - comp.soft-sys.matlab ... Convert all cell array to string - comp.soft-sys.matlab Convert comma separated string to cellarray ... cell array to csv - comp.soft-sys.matlab... sys.matlab cell array to csv - comp.soft-sys.matlab Hi, I was wondering if there a way to write a cell array ... csv - comp.soft-sys.matlab Convert comma separated string ... Array conversion to matrix - comp.soft-sys.matlabConvert comma separated string to cellarray - comp.soft-sys.matlab ... Convert comma separated string to cellarray - comp.soft-sys.matlab ... Array conversion to matrix ... Counting comma seperated fields - comp.lang.awkconvert integer to string - comp.lang.perl.misc... my user requested the app to ... lucky that there are an odd number ... Convert comma separated string to cellarray - comp ... converting .NET System.String objects to matlab strings - comp ...Convert all cell array to string - comp.soft-sys.matlab converting .NET System.String ... cell2css This is a MATLAB function to convert a cell array of strings to a comma ... how to write array value into csv file? - comp.lang.ruby ...... comp.soft-sys.matlab ... cell array to csv - comp.soft-sys.matlab File Exchange - MATLAB Central Writes a cell array into a comma separated ... reading csv file with string ... Converting string values with the wrong decimal separator into ...Converting string values with the wrong ... used in the original string variable (REPLY.1) is a comma. How can I convert REPLY ... in repeating fields are separated by ... write a cell array to text file.. - comp.soft-sys.matlab ...Converting Certain Data from Numeric Matrix ... Exchange - MATLAB Central Writes a cell array into a comma separated ... How do I write a cell array of strings to a file using ... Convert comma separated string to cellarray - comp.soft-sys.matlab ...Hi Matlab users I have a string like: string=['test1', 'test2','test3'] I want to convert the string to a cellarray: cellarray={'test1', ... How to convert comma-separated string to cell array of strings in ...Here's a solution that will cut up the string at commas, semicolons, or white spaces, and that will work for strings of any length. string = 'A, BB, C' tmp = regexp ... 7/24/2012 1:06:48 AM
|
|
|
|
|
|
|
|
|