How do I convert the (n, n) matrix to a (nxn,1) vector? Any suggestions?

It would be of great help if someone can give some suggestions, or the MATLAB command which does this operation.

 Accepted Answer

vertcat(A,A)

6 Comments

Thank you @Torsten :)
Thank you for your answer. What I mean by (n*n,1) is stacking of same matrix and later considering it as an array of data in 1 column.
see the edited code it gives what you want
Let A = [1 2; 3 4]. The output I need should look something like A = [1 2; 3 4; 1 2; 3 4; 1 2; 3 4; 1 2; 3 4]. The number of matrix to be stacked is the numeric multiplication of initial matrix dimensions

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!