double to string in a cell

18 views (last 30 days)
Vincent I
Vincent I on 17 Jun 2013
Hi, is there an easier way to convert from double to string in a cell?
Thank you
Left = {num2str(variable1)
num2str(variable2)
num2str(variable3)
etc...}
set(handles.Left_Listbox,'String',Left)

Accepted Answer

Azzi Abdelmalek
Azzi Abdelmalek on 17 Jun 2013
Edited: Azzi Abdelmalek on 17 Jun 2013
A={1 2 12 25}
B=cellfun(@num2str,A,'un',0)
  4 Comments
Azzi Abdelmalek
Azzi Abdelmalek on 17 Jun 2013
your error message?
Vincent I
Vincent I on 17 Jun 2013
I got it thank you by doing the following:
B = cellfun(@num2str,Left,'UniformOutput',false)

Sign in to comment.

More Answers (1)

Evan
Evan on 17 Jun 2013
Edited: Evan on 17 Jun 2013
help cellfun

Categories

Find more on Characters and Strings in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!