Effacer les filtres
Effacer les filtres

could anyone help me to rearrange the matrix in the required manner.

2 vues (au cours des 30 derniers jours)
jaah navi
jaah navi le 11 Sep 2019
Modifié(e) : Bruno Luong le 12 Sep 2019
I ma having a matrix A=[ 1 0 0 0;
2 0 0 0;
3 4 0 0;
5 6 7 0]
i need to rearrange the matrix in the following manner
A=[1 2 3 5;
0 0 4 6;
0 0 0 7;
0 0 0 0]

Réponse acceptée

Bruno Luong
Bruno Luong le 11 Sep 2019
  4 commentaires
jaah navi
jaah navi le 12 Sep 2019
yes.its my mistake
Bruno Luong
Bruno Luong le 12 Sep 2019
Modifié(e) : Bruno Luong le 12 Sep 2019
I can only see one thing that you want beside A.' (but why don't you tell use what is the desired output)?
x = 1:min(size(A));
A(x,x) = A(x,x).'

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Particle & Nuclear Physics dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by