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

조회 수: 22 (최근 30일)
minsoo kim
minsoo kim 2017년 12월 1일
댓글: Muhammad Danish 2022년 10월 27일
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?

답변 (1개)

Guillaume
Guillaume 2017년 12월 1일
편집: Guillaume 2017년 12월 1일
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
Mohammad Safayet Hossain
Mohammad Safayet Hossain 2018년 11월 24일
Thanks a lot...It works nicely....
Muhammad Danish
Muhammad Danish 2022년 10월 27일
its not working bro

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 연산자와 기초 연산에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!