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

87 Ansichten (letzte 30 Tage)
minsoo kim
minsoo kim am 1 Dez. 2017
Kommentiert: Muhammad Danish am 27 Okt. 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?

Antworten (1)

Guillaume
Guillaume am 1 Dez. 2017
Bearbeitet: Guillaume am 1 Dez. 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 Kommentare
Mohammad Safayet Hossain
Mohammad Safayet Hossain am 24 Nov. 2018
Thanks a lot...It works nicely....

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu 행렬과 배열 finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!