4.66667

4.7 | 3 ratings Rate this file 233 downloads (last 30 days) File Size: 1.53 KB File ID: #13999

cell2str

by Per-Anders Ekstrom

 

19 Feb 2007 (Updated 20 Feb 2007)

Code covered by BSD License  

Convert a 2-D cell array of strings to a string in MATLAB syntax.

Download Now | Watch this File

File Information
Description

STR = CELL2STR(CELLSTR) converts the 2-D cell-string CELLSTR to a MATLAB string so that EVAL(STR) produces the original cell-string.
Works as corresponding MAT2STR but for cell array of strings instead of scalar matrices.
 
Example
cellstr = {'U-234','Th-230'};
cell2str(cellstr) produces the string '{''U-234'',''Th-230'';}'.

MATLAB release MATLAB 7.2 (R2006a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (3)
06 May 2008 Alfredo IƱigo

aa

22 May 2008 Virginia Woods

Works great. Thanks

06 Jan 2009 Craig Derian

took some small mods to work for structure dynamic field name creation, but very nice

Please login to add a comment or rating.
Updates
20 Feb 2007

Updated bug if any string in cell-string consisted of a '-character.

Tag Activity for this File
Tag Applied By Date/Time
structures Per-Anders Ekstrom 22 Oct 2008 09:01:04
cell arrays Per-Anders Ekstrom 22 Oct 2008 09:01:04
cell string mat2str Per-Anders Ekstrom 22 Oct 2008 09:01:04
cell arrays Sascha 08 Jan 2009 03:34:43
cell string mat2str Harsha Kasi 17 Jul 2009 07:39:52
cell arrays Harsha Kasi 17 Jul 2009 07:39:55
structures Harsha Kasi 17 Jul 2009 07:39:57
 

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