Removing rows from array using indices

63 Ansichten (letzte 30 Tage)
Pelajar UM
Pelajar UM am 1 Nov. 2021
Kommentiert: Star Strider am 1 Nov. 2021
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?

Akzeptierte Antwort

Star Strider
Star Strider am 1 Nov. 2021
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 Kommentare
Pelajar UM
Pelajar UM am 1 Nov. 2021
Wonderful! Thanks a lot for your time. I really appreciate it.
Star Strider
Star Strider am 1 Nov. 2021
Thank you!
As always, my pleasure!
.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by