Code covered by the BSD License  

Highlights from
cell2str

3.0

3.0 | 1 rating Rate this file 11 Downloads (last 30 days) File Size: 1.69 KB File ID: #28462

cell2str

by Cris Luengo

 

12 Aug 2010

Convert 2-D cell array into evaluable string

| Watch this File

File Information
Description

B = CELL2STR(C) returns a B such that C = EVAL(B).

This is the same as NUM2STR, except it works on cell arrays that contain strings and numeric arrays. C must be a 2D cell array. B will be a string that can be evaluated. to return a cell array identical (up to numerical accuracy) to C.

Optional input arguments:

B = CELL2STR(C,N) uses N digits of precision for numeric arrays. N defaults to 15.

B = CELL2STR(C,'class') and B = CELL2STR(C,N,'class') also include the class string for the numeric arrays.

MATLAB release MATLAB 7.10 (2010a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (1)
28 Jul 2011 Julien Gaugaz

Works great for flat cell arrays, but doesn't work for cell-arrays containing other cell-arrays, e.g.:
>> utils.cell2str({{1}})
??? Error using ==> cell2str at 64
Illegal value in cell array.

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
cell array Cris Luengo 12 Aug 2010 11:22:02
numeric array Cris Luengo 12 Aug 2010 11:22:02
string Cris Luengo 12 Aug 2010 11:22:02
conversion Cris Luengo 12 Aug 2010 11:22:02
convert Cris Luengo 12 Aug 2010 11:22:02
eval Cris Luengo 12 Aug 2010 11:22:02
eval lan tian 17 Jul 2011 11:11:06

Contact us at files@mathworks.com