Clear Filters
Clear Filters

Info

This question is closed. Reopen it to edit or answer.

i have a matrix A(25357*2), i want to delete rows as i explained below. any help?

1 view (last 30 days)
In the attachced excel sheet above,
Some rows starts with 1(40rows),some rows starts with 2(58rows), some rows starts with 3(55rows) and so on....
if we consider rows starting with 1, the corresponding 40 column values
6
42
50
55
57
62
83
107
148
157
186
211
213
245
261
282
284
333
429
471
490
506
537
549
551
590
659
693
698
763
769
778
782
794
797
876
881
965
970
991
so if we consider the above values, i want to delete rows starting with 6,42,50,55,57,........991 from matrix A
since value 2 is not there in the list , rows starting with 2 should not be deleted, now again consider 58 rows starting with 2, the rows starting with these 58 column values should be deleted.
next rows starting with three and rows starting with these 55 column values should be deleted.
and so on....
when it comes rows starting with 6are already deleted in the first operation.so it should start with rows starting with 7.
and whole process should continue..

Answers (1)

Raghav Singhal
Raghav Singhal on 20 Feb 2019
Hi,
You can try using logical vectors if it helps resolve your query. You can refer to the documentation link below for more details

This question is closed.

Community Treasure Hunt

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

Start Hunting!