필터 지우기
필터 지우기

array of numbers to chars in separate cells

조회 수: 1 (최근 30일)
Tomas
Tomas 2012년 4월 30일
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'};

채택된 답변

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

추가 답변 (2개)

Honglei Chen
Honglei Chen 2012년 4월 30일
E = mat2cell(F,1,ones(1,4)])

Tomas
Tomas 2012년 4월 30일
OK, but i need those E values to be not in [ ], but in ' ', it means in char.

카테고리

Help CenterFile Exchange에서 Data Types에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by