Effacer les filtres
Effacer les filtres

array of numbers to chars in separate cells

1 vue (au cours des 30 derniers jours)
Tomas
Tomas le 30 Avr 2012
Hi, I would like to know how to get separate cells with chars from number array:
from
F=[1 20 30 100];
to
E={'1','20','30','100'};

Réponse acceptée

Honglei Chen
Honglei Chen le 30 Avr 2012
E = cellfun(@num2str,mat2cell(F,1,ones(1,4)),'UniformOutput',false)

Plus de réponses (2)

Honglei Chen
Honglei Chen le 30 Avr 2012
E = mat2cell(F,1,ones(1,4)])

Tomas
Tomas le 30 Avr 2012
OK, but i need those E values to be not in [ ], but in ' ', it means in char.

Catégories

En savoir plus sur Data Types dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by