Hey guys , How can i shift rows or columns within an array?
Ältere Kommentare anzeigen
A = [ 1,2,3;4,5,6;7,8,9] How do i shift [1 , 2 , 3] to where [ 4,5,6] is?
2 Kommentare
Cedric
am 22 Sep. 2017
What do you mean by "shift"? Can you give an example of what the output should be? And what have you tried so far?
Akira Agata
am 22 Sep. 2017
You mean, you want to do 'circshift' like this ?
>> circshift(A,1,1)
ans =
7 8 9
1 2 3
4 5 6
Antworten (1)
Andrei Bobrov
am 22 Sep. 2017
A([2,1],:) = A(1:2,:)
or
circshift(A,1)
Kategorien
Mehr zu Data Types finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!