>> > >> A(ismember(A,H1))= >> > > fyi; > > another way is > > A = setdiff(A,H1);
Just watch out, that setdiff() returns the result SORTED, while the first solution leaves things as is.
This might be ok for your A or not. It depends on your use. But you can still use setdiff() if you want, and get the order back the way it was in A, since setdiff have another way to be called where it return the indices used (see help). But this means another extra step to 'unsort' things to the way it was.
I did not see an option to tell setdiff() NOT to sort the result, but I might have missed it.