How to delete entire row of an array?

Illustration
Jason - 2023-06-06T13:56:06+00:00
Question: How to delete entire row of an array?

How can I remove the entire row if either value is less than 5:   Coord = 2 3 2 39 1 88 9 74 10 93 16 28 16 50  

Expert Answer

Profile picture of Prashant Kumar Prashant Kumar answered . 2025-11-20

Use any and logical indexing:

 

>> Coord = [2,3;2,39;1,88;9,74;10,93;16,28;16,50];
>> Coord(any(Coord<5,2),:) = []
Coord =
    9   74
   10   93
   16   28
   16   50

 


Not satisfied with the answer ?? ASK NOW

Get a Free Consultation or a Sample Assignment Review!