How can I convert a vector to 2D matrix correctly?
32 views (last 30 days)
I have a vector A(33807). I would like to convert it to matrix B(177X191). I tried it with reshape function:
But I am not sure that it is correct. Could someone recommend me a better way? Thank you for your help in advance!
Thorsten on 29 Sep 2015
Edited: Thorsten on 29 Sep 2015
That's correct. Note that reshape works along order of dimensions, so in this case the first 177 values of A would go to the first column of B, the next 177 values to the second column, and so on.
If instead the first 191 values should go to row 1, you have to write