HOW TO SHIFT COLUMN AND ROW MATRIX

hy guys. please help me, I dont know to shift column and row in matlab. please see image below. thanks. :)

 Accepted Answer

Matt J
Matt J on 19 Jan 2021
Edited: Matt J on 19 Jan 2021
x=repmat([1 2 3 4],4,1); x(6,6)=0
x = 6×6
1 2 3 4 0 0 1 2 3 4 0 0 1 2 3 4 0 0 1 2 3 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0
perm=[1,2,5,6,3,4];
x(perm,perm),
ans = 6×6
1 2 0 0 3 4 1 2 0 0 3 4 0 0 0 0 0 0 0 0 0 0 0 0 1 2 0 0 3 4 1 2 0 0 3 4

3 Comments

Cool. Its works. Thanks a lot😀
You're welcome, but please Accept-click the answer to indicate that it worked.
Noted sir, thanks for the answer

Sign in to comment.

More Answers (0)

Categories

Products

Asked:

on 19 Jan 2021

Commented:

on 19 Jan 2021

Community Treasure Hunt

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

Start Hunting!