MATLAB: Deleting specific rows in an array based on values in another array

deleterowsseparate vectors

I have two 16×1 column vectors, the first is [1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 12; 13; 14; 15; 16], and another [777; 777; 0; 0; -9; 0; 0; -6; 0; 0; 0; 777; 0; 0; 0; 777]
I need to delete the values from the first column that correspond to the rows in column 2 that contain 777
i.e. [1; 2; 12; 16]

Best Answer

vector_1(vector_2 == 777) = []