Circshift not working for values of zero.

1 次查看(过去 30 天)
I have;
x = [0 0 3 3]
I want this to become
x = [0 3 3 0]
When I circshift
x_2 = circshift(x,2)
it equalls [0 0 3 3].
Am I doing the right circshift? NOTE I want it reordered with the second element first keeping the sequence.

采纳的回答

Mischa Kim
Mischa Kim 2014-3-26
Use
x_2 = circshift(x',-1,1)'

更多回答(1 个)

Azzi Abdelmalek
Azzi Abdelmalek 2014-3-26
x_2=circshift(x,[0 -1])

类别

Help CenterFile Exchange 中查找有关 Startup and Shutdown 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by