How to remove certain value from array and reshape the array?

138 vues (au cours des 30 derniers jours)
minsoo kim
minsoo kim le 1 Déc 2017
Commenté : Muhammad Danish le 27 Oct 2022
I want to delete every -120 value from S(i x j) and reshape the S without -120.
Only S(X, certain 'Y's) have this -120 value.
Any ideas?

Réponses (1)

Guillaume
Guillaume le 1 Déc 2017
Modifié(e) : Guillaume le 1 Déc 2017
Deleting arbitrary elements from an array will always automatically reshape it into a vector unless you explicitly delete entire rows, columns, pages, etc.
So:
S(S == -120) = [];
will delete all -120 values and reshape your array at the same time.
  3 commentaires
Mohammad Safayet Hossain
Mohammad Safayet Hossain le 24 Nov 2018
Thanks a lot...It works nicely....
Muhammad Danish
Muhammad Danish le 27 Oct 2022
its not working bro

Connectez-vous pour commenter.

Catégories

En savoir plus sur 행렬과 배열 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!