how to merge two vectors

2 次查看(过去 30 天)
A= [ 0.567 6.345 1.789 0.678 0.4678] B= [0 0 0 0 0 0 0 ]
result will be
C= [0.567 6.345 1.789 0.678 0.4678 0 0]

采纳的回答

Mischa Kim
Mischa Kim 2014-2-14
编辑:Mischa Kim 2014-2-14
How about:
C = B + [A zeros(1,length(B)-length(A))]
assuming that by merge you mean add-merge. If it's just about adjusting the size of the vector, then use
C = [A zeros(1,length(B)-length(A))]

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Standard File Formats 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by