MATLAB: Delete array element values from another array element values

delete array from another array

Hi Everyone,
Suppose I have the following
A = [1 2 3]
and
Z = [1 2 3 4 5 6]
how do I remove the values of A from Z, to get
Z = [4 5 6] in matlab
Regards,Chandradhar Savanth

Best Answer

setdiff(Z,A)