Circshift not working for values of zero.

1 view (last 30 days)
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.

Accepted Answer

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

More Answers (1)

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

Categories

Find more on Startup and Shutdown in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!