MATLAB Answers

how to reshape a matrix to a vector?

3 views (last 30 days)
sama
sama on 21 May 2018
Answered: sama on 21 May 2018
I have a matrix for example [1 2 3; 4 5 6; 7 8 9]. I want to return it to [1 2 3 4 5 6 7 8 9] how can I do that please? Thanks

  0 Comments

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 21 May 2018
reshape(A.', 1, [])

  0 Comments

Sign in to comment.

More Answers (1)

sama
sama on 21 May 2018
Thanks a lot. I used reshape but totally had forgot about transpose ('). Thank you

  0 Comments

Sign in to comment.

Sign in to answer this question.

Tags