MATLAB: How to select rows in an array based on the values in the first row of another array

anotherarrayrowrows

Hi suppose I have a column of values like :
How do I select every other row that are not displayed in the rows above in another new array. Example: I will want all other row 1,2,4,5….. excluding row 3, 39,51,15,28,65 and 56.
Please help, Thank you!

Best Answer

idx = setdiff(1:size(yourarray,1),yourvector)
out = yourarray(idx,:)