No License

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

» Watch video

Highlights from

5.0 | 5 ratings Rate this file 4 Downloads (last 30 days) File Size: 2.35 KB File ID: #20639 Version: 1.0




09 Jul 2008 (Updated )

num2CellStr converts numeric or logical array to a cell array of strings

| Watch this File

File Information

num2CellStr - converts numeric or logical array to a cell array of strings

This was inspired by a recent FEX submission of the same name. However,
it should run about 100 times faster. It also runs ~12 times faster than
the one liner:

    cellA = reshape(cellstr(num2str(A(:))),size(A));


strCell = num2CellStr(x, format)

Input parameters:

      x - mandatory matrix of numeric values
      format - optional format specifier. If not specified one is
                  picked based on the data up to 5 decimal places

Output parameters:

      strCell - cell array of strings



ans =

    '0.06' '0.61'
    '0.13' '0.39'

See also:
num2cell, mat2cell, textscan, strread


This file inspired Visualization Of Correlation Matrix: Mycorrplot 1, Mycorrplot 2.

MATLAB release MATLAB 7.5 (R2007b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (5)
16 Nov 2016 noknowledge


14 Oct 2014 Wei-Ting Lin

Great! Just what I need. Thank you!

21 Aug 2014 Haruki

Haruki (view profile)


05 Aug 2009 Dirk Engel

16 Mar 2009 john

john (view profile)

Extremely useful! Works just like I thought it would.

Contact us