MATLAB: Removing equal elements from a matrix

removing equal elements

Hi all,
I have a matrix like "a" whose some elemnts are equal to each other. I wato to transform this matrix to a vector like "b" with non-equal elements.
e.g. a=[ 1 2 3 ; 3 4 5; 6 4 7]; >> b=[1 2 3 4 5 6 7];
How can I write this program? Thanks in advance.

Best Answer

a=[ 1 2 3 ; 3 4 5; 6 4 7];
b=unique(a(:))'