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

316 visualizaciones (últimos 30 días)
minsoo kim
minsoo kim el 1 de Dic. de 2017
Comentada: Muhammad Danish el 27 de Oct. de 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?

Respuestas (1)

Guillaume
Guillaume el 1 de Dic. de 2017
Editada: Guillaume el 1 de Dic. de 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 comentarios
Mohammad Safayet Hossain
Mohammad Safayet Hossain el 24 de Nov. de 2018
Thanks a lot...It works nicely....

Iniciar sesión para comentar.

Categorías

Más información sobre Matrix Indexing en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!