1.0

1.0 | 2 ratings Rate this file 135 downloads (last 30 days) File Size: 780 Bytes File ID: #23229

CELL2STR

by Daniel Claxton

 

08 Mar 2009

No BSD License  

CELL2STR converts a cell array of strings into a character array.

Download Now | Watch this File

File Information
Description

CELL2STR converts a cell array of strings into a character array. The resulting character array is possible by padding the strings in each row with spaces.

Example
str = {'this' 'is' 'a' 'test' 'of' 'cell' '2' 'str'};
cell2str(str)

MATLAB release MATLAB 7.4 (R2007a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (4)
09 Mar 2009 Kenneth Eaton

How is this different from the following?...

>> str = {'this' 'is' 'a' 'test' 'of' 'cell' '2' 'str'};
>> char(str)

ans =

this
is
a
test
of
cell
2
str

10 Mar 2009 Jos (10584)

Nice programming exercise for duplicating the built-in CHAR function. Please remove.

10 Mar 2009 us

this is exactly what CHAR does - in one simple shot...
us

24 Sep 2009 Marco Cococcioni

Although Jos and us are right, I think this function deserves to stay here, because its name is more intuitive that the built-in 'char', which is not expected to do the conversion. The high number of downloads of this function seems to confirm my opinion. Best regards, MC

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
data export Daniel Claxton 09 Mar 2009 14:01:02
data import Daniel Claxton 09 Mar 2009 14:01:02
matrix Daniel Claxton 09 Mar 2009 14:01:02
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com