Hi Everyone!
Hi would like to concatenate the entries of non-negative matrix into one single number! is that possible? any Ideas?
Here is an example:
a=[6 0 11; 15 5 10; 10 12 13]
and I want it to become:
a=[6011;15510;101213]
any suggestions?
Thank you in advance! all the best!

 採用された回答

Andrei Bobrov
Andrei Bobrov 2012 年 4 月 19 日

0 投票

a = str2double(arrayfun(@(x)sprintf('%d',a(x,:)),(1:size(a,1))','un',0))
variant
a = str2double(regexprep(cellstr(num2str(a)),' ',''))

1 件のコメント

Hugo
Hugo 2012 年 4 月 19 日
Thanks a lot!

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

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by