Circshift not working for values of zero.

1 Ansicht (letzte 30 Tage)
Giuseppe
Giuseppe am 26 Mär. 2014
Beantwortet: Azzi Abdelmalek am 26 Mär. 2014
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.

Akzeptierte Antwort

Mischa Kim
Mischa Kim am 26 Mär. 2014
Use
x_2 = circshift(x',-1,1)'

Weitere Antworten (1)

Azzi Abdelmalek
Azzi Abdelmalek am 26 Mär. 2014
x_2=circshift(x,[0 -1])

Kategorien

Mehr zu Startup and Shutdown finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by