MATLAB: Subtract a row from a matrix

matrix

I have a matrix A = [ 1 2 3; 3 5 9; 1 8 0; 2 3 3 ] and the value of third row is stored in another matrix B = [1 8 0], how can i subtract B from A? i tried this A(B,:)=[] but not working.

Best Answer

>> A = [1,2,3;3,5,9;1,8,0;2,3,3];
>> B = [1,8,0];
>> [~,idx] = ismember(B,A,'rows');
>> A(idx,:) = []
A =
1 2 3
3 5 9
2 3 3