필터 지우기
필터 지우기

how i cab convert numbers into letters

조회 수: 4 (최근 30일)
Mohamuud hassan
Mohamuud hassan 2015년 6월 2일
편집: Stephen23 2015년 6월 2일
hello all how i can convert number which are stored in cell array in alphabet?
numbers12 = [3,6,12,1,1,3,26,20]
lettter={,,,,,}

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2015년 6월 2일
numbers12 ={3,6,12,1,1,3,26,20}
lettter=cellfun(@num2str,numbers12,'un',0)
  댓글 수: 1
Stephen23
Stephen23 2015년 6월 2일
편집: Stephen23 2015년 6월 2일
As the question gives a numeric vector, then arrayfun will also work:
>> X = [3,6,12,1,1,3,26,20];
>> arrayfun(@num2str,X,'un',0)
ans =
'3' '6' '12' '1' '1' '3' '26' '20'

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Shrirang
Shrirang 2015년 6월 2일
Hi , You can use num2str command. e.g. numbers12 = num2str(numbers12 ) so your number array in char Hope this helps you.

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by