View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from

Join the 15-year community celebration.

Play games and win prizes!

» Learn more

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




12 Aug 2010 (Updated )

Convert 2-D cell array into evaluable string

| Watch this File

File Information

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.

Comment only
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.

13 Jul 2012 1.1

Extended to work with cell arrays.

Contact us