array of numbers to chars in separate cells

Asked by Tomas on 30 Apr 2012
Latest activity Answered by Honglei Chen on 30 Apr 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'};

0 Comments

Tomas

Products

No products are associated with this question.

3 Answers

Answer by Honglei Chen on 30 Apr 2012
Accepted answer
E = cellfun(@num2str,mat2cell(F,1,ones(1,4)),'UniformOutput',false)

0 Comments

Honglei Chen
Answer by Honglei Chen on 30 Apr 2012
E = mat2cell(F,1,ones(1,4)])

0 Comments

Honglei Chen
Answer by Tomas on 30 Apr 2012

OK, but i need those E values to be not in [ ], but in ' ', it means in char.

0 Comments

Tomas

Contact us