A= [2 3 4]; B=[2 3 4]; Output C=[22 33 44]; Merge 2 matrix elements

1 次查看(过去 30 天)
HI,
I want to merge a matrix A(1xN) with B(1xN)....The elements in both matrices are same.....the output C(1xN) should merge both matrices......
Thank you
  1 个评论
Praveen
Praveen 2012-11-12
编辑:Praveen 2012-11-12
A=[11 12 13] B=[11 12 13]
i want the output C = [1111 1112 1113 ; 1211 1212 1213 ; 1311 1312 1313]
help me out.... :)

请先登录,再进行评论。

采纳的回答

Matt J
Matt J 2012-11-12
编辑:Matt J 2012-11-12
C=(10.^ceil(log10(A+1))).*A + A

更多回答(3 个)

Walter Roberson
Walter Roberson 2012-11-12
A*10 + B

Harshit
Harshit 2012-11-12
here it is
A= num2str(A)
B = num2str(B)
C=strcat(A',B')
C=str2num(C)
  1 个评论
Praveen
Praveen 2012-11-12
HI, thank you... it is working for single digits..... but it is showing blank output when i execute for 2 digits.... help me out
thank you

请先登录,再进行评论。


Azzi Abdelmalek
Azzi Abdelmalek 2012-11-12
编辑:Azzi Abdelmalek 2012-11-12
A=[11 22 33];
c=num2str(A')
d=[c,c]
B=str2num(d)
B=B'

类别

Help CenterFile Exchange 中查找有关 Resizing and Reshaping Matrices 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by