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)),' ',''))

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

태그

질문:

2012년 4월 19일

Community Treasure Hunt

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

Start Hunting!

Translated by