
Re: Transform matrix to vector
Posted:
Jul 6, 2009 5:42 AM


"Sprinceana " <mihaispr@yahoo.com> wrote in message <h2s4c1$3aj$1@fred.mathworks.com>... > I have the matrix: > > A=[1 2 3;4 5 6; 6 7 8] > > And I want to obtain the vector line: > > 1 2 3 4 5 6 7 8 > > What I did: > > >>A = [1 2 3;4 5 6; 6 7 8] % matrix definition > >>b=A(1,:) % extract line 1 of matrix A in vector b > >>c=A(2,:) % extract line 2 of matrix A in vector c
> >>d=A(3,:) % % extract line 3 of matrix A in vector d > >>result=[b c d] %concatenate the 3 vectors b,c,d in a single vector result > >>unique(result) % eliminate doubled elements from vector result > > Is there another method to obtain that? I wait your advices!
"Help reshape" maybe
Regards
Dave Robinson

