HOW TO SHIFT COLUMN AND ROW MATRIX

16 vues (au cours des 30 derniers jours)
Wahyu A
Wahyu A le 19 Jan 2021
Commenté : Wahyu A le 19 Jan 2021
hy guys. please help me, I dont know to shift column and row in matlab. please see image below. thanks. :)

Réponse acceptée

Matt J
Matt J le 19 Jan 2021
Modifié(e) : Matt J le 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 commentaires
Matt J
Matt J le 19 Jan 2021
You're welcome, but please Accept-click the answer to indicate that it worked.
Wahyu A
Wahyu A le 19 Jan 2021
Noted sir, thanks for the answer

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Matrix Indexing dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by