double to string in a cell

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)

 Respuesta aceptada

Azzi Abdelmalek
Azzi Abdelmalek el 17 de Jun. de 2013
Editada: Azzi Abdelmalek el 17 de Jun. de 2013

0 votos

A={1 2 12 25}
B=cellfun(@num2str,A,'un',0)

4 comentarios

Vincent I
Vincent I el 17 de Jun. de 2013
Doesnt work. Probably has something to do with variable Left which looks like this:
Left = [ 0 ]
[ 1 ]
[ 1 ]
etc
Vincent I
Vincent I el 17 de Jun. de 2013
nvm
B = cellfun(@num2str,Left,'UniformOutput',false)
Azzi Abdelmalek
Azzi Abdelmalek el 17 de Jun. de 2013
your error message?
Vincent I
Vincent I el 17 de Jun. de 2013
I got it thank you by doing the following:
B = cellfun(@num2str,Left,'UniformOutput',false)

Iniciar sesión para comentar.

Más respuestas (1)

Evan
Evan el 17 de Jun. de 2013
Editada: Evan el 17 de Jun. de 2013

0 votos

help cellfun

Categorías

Más información sobre Characters and Strings en Centro de ayuda y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by