How i can remove inf value and zero value in 10x10 Matrix?

43 vues (au cours des 30 derniers jours)
Arsal15
Arsal15 le 25 Jan 2016
Modifié(e) : Arsal15 le 25 Jan 2016
Hi, I want to remove the highlight red data from the 10x10 matrix and also the index (i=j) which is inf.? Need your guidance. One more thing I want to extract the indices where the value is non zero?

Réponse acceptée

goerk
goerk le 25 Jan 2016
Modifié(e) : goerk le 25 Jan 2016
I assume you want the finite values which are not zero?
A % input Matrix
nonZeroValues = A(A~=0 & isfinite(A));
to get the indices you can run
ind = find(A~=0 & isfinite(A))
[row col] = ind2sub(size(A), ind)
  1 commentaire
Arsal15
Arsal15 le 25 Jan 2016
Modifié(e) : Arsal15 le 25 Jan 2016
Thanks goerk :)

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

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

Community Treasure Hunt

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

Start Hunting!

Translated by