How can I shift a vector numerically to the right (or the left) by adding zeros to the side of the array?

16 次查看(过去 30 天)
Supposing I have a vector x=[1 2 3] and I need it to shift it to the right of two integers how can i generate a new vector x1=[0 0 1 2 3]

采纳的回答

madhan ravi
madhan ravi 2019-8-13
x1=[zeros(1,2),x]

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Data Types 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by