MATLAB: How to delete columns from a matrix based on an array

delete columnsdelete columns and rows from matrix

I have matrix of A=[4 3 5 6 7; 1 4 8 4 7] and B=[3 6 7] and i want do delete columns of A which's first row contain the values of B and have the answer; A= [4 5; 1 8]
thank you

Best Answer

A(:,ismember(A(1,:),B)) = [];