Removing rows from array using indices

조회 수: 3(최근 30일)
Pelajar UM
Pelajar UM 2021년 11월 1일
댓글: Star Strider 2021년 11월 1일
I have a 2530x1 array named Rowidx containing the indices of rows that I want to remove from several other arrays that have different dimenions.
What's the best way of doing this in MATLAB?

채택된 답변

Star Strider
Star Strider 2021년 11월 1일
If ‘Rowidx’ is a logical array, that might not work as desired. If it is a numerical array, then if ‘A’ is any of the arrays —
A(Rowidx,:) = [];
would work.
.
  댓글 수: 10
Star Strider
Star Strider 2021년 11월 1일
Thank you!
As always, my pleasure!
.

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

추가 답변(0개)

태그

Community Treasure Hunt

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

Start Hunting!

Translated by