I have a vector s
, which is of size 1*163840
which comes from sizeX * sizeY * sizeZ = 64 * 40 * 60
. I want to convert the 1*163840 vector to a 3-dimensional matrix, which has 64 in x-axis, 40 in y-axis, and 64 in z-axis.
What is the easiest way to convert it?
Use reshape to do it easily:
new_matrix = reshape(s, 64, 40, 60);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With