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

14 visualizzazioni (ultimi 30 giorni)
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?

Risposte (1)

Guillaume
Guillaume il 1 Dic 2017
Modificato: Guillaume il 1 Dic 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.

Categorie

Scopri di più su 연산자와 기초 연산 in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!