I have 2 arrays A = [ 1 2 3 4 5] B = [ 0 0 3] How do can i get C = [ 1 2 3 4 5;0 0 3 0 0] in a general way because im running loop with B changing each loop? A size remain the same. Size B<A.

 采纳的回答

A = [ 1 2 3 4 5]
B = [ 0 0 3]
C=[A;B zeros(1,numel(A)-numel(B))]

更多回答(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