How to join the elements of char array?

조회 수: 1 (최근 30일)
Kushal Khaitan
Kushal Khaitan 2013년 3월 31일
I have an array with size not fixed depends on the inputs from the user. It is eg. 8X2 char array. I want to combine the array in 1 string.
eg. If it consists 61 62 63 64 65
I want a string of the form "6162636465"
Plz help as soon as possible.

답변 (1개)

Andrei Bobrov
Andrei Bobrov 2013년 3월 31일
a=[61 62 63 64 65]
out = sprintf('%d',a)
  댓글 수: 3
Kushal Khaitan
Kushal Khaitan 2013년 3월 31일
i want to save it as one variable
Cedric
Cedric 2013년 3월 31일
편집: Cedric 2013년 3월 31일
What is this out for you in the answer given by Andrei?
-> doc sprintf

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

카테고리

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