Code covered by the BSD License  

Highlights from
cell2str

3.0

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

cell2str

by

 

12 Aug 2010 (Updated )

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, numeric arrays and other cell 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.

Required Products MATLAB
MATLAB release MATLAB 7.9 (R2009b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (2)
13 Jul 2012 Cris Luengo

Now also works for cell arrays containing other cell arrays.

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.

Updates
13 Jul 2012

Extended to work with cell arrays.

Contact us