Circshift not working for values of zero.

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 日

1 投票

Use
x_2 = circshift(x',-1,1)'

その他の回答 (1 件)

カテゴリ

製品

質問済み:

2014 年 3 月 26 日

回答済み:

2014 年 3 月 26 日

Community Treasure Hunt

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

Start Hunting!

Translated by