Concatenation

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!

 采纳的回答

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 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by