Adding matrix values into a string

조회 수: 2 (최근 30일)
Ilan Kurtser
Ilan Kurtser 2020년 12월 2일
댓글: Ilan Kurtser 2020년 12월 2일
Hello,
I want to turn a matrix
a=[1 2 3 4 5 6 7 8 9] for say
into a string with the three first values of the array
b=123;
Any ideas how to do it?

채택된 답변

KSSV
KSSV 2020년 12월 2일
a=[1 2 3 4 5 6 7 8 9] ;
str = char(a+'0')
str = '123456789'
  댓글 수: 3
KSSV
KSSV 2020년 12월 2일
a=[1 2 3 4 5 6 7 8 9] ;
str = char(a(1:3)+'0')
str = '123'
Ilan Kurtser
Ilan Kurtser 2020년 12월 2일
Thank you very much!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Characters and Strings에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by