Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: num2cellstr
Date: Tue, 28 Oct 2008 21:27:01 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 16
Message-ID: <ge8035$2q0$1@fred.mathworks.com>
References: <eb6328b2-f07e-44c5-a225-f9ea5bee1408@u29g2000pro.googlegroups.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1225229221 2880 172.30.248.38 (28 Oct 2008 21:27:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 28 Oct 2008 21:27:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 870065
Xref: news.mathworks.com comp.soft-sys.matlab:497707


Jason S <jmsachs@gmail.com> wrote in message <eb6328b2-f07e-44c5-a225-f9ea5bee1408@u29g2000pro.googlegroups.com>...
> is there a function that converts an array of numbers to a cell array
> of strings?
> num2cell converts array of numbers -> cell array of numbers
> num2str converts array of numbers -> char array (but not cell array)
> 
> I suppose I can do this easily, it just seems like an obvious idea for
> a builtin function

what about:

data = rand(3,4)
CS = reshape(cellstr(num2str(A(:))),size(A))

hth
Jos