How to join the elements of char array?

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 日

1 投票

a=[61 62 63 64 65]
out = sprintf('%d',a)

3 件のコメント

Kushal Khaitan
Kushal Khaitan 2013 年 3 月 31 日
not useful
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

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeCharacters and Strings についてさらに検索

質問済み:

2013 年 3 月 31 日

Community Treasure Hunt

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

Start Hunting!

Translated by