How to Convert 4D-Single to MxNXN

12 views (last 30 days)
mohd akmal masud
mohd akmal masud on 30 Jun 2022
Dear all,
I have 100 set data 4D-Single. anyone know how to convert it to MxNxN?
Letsay my 4D-Single is cropVol, want to convert to g (see the picture in workspace)
  21 Comments
Bjorn Gustavsson
Bjorn Gustavsson on 1 Jul 2022
When the 4-D array-size is [176 224 152 4] the only way to put your 4-D array into an N-by-N-by-M array, as you requested is to put the elements into an 128-by-128-by-1463 array. You can do that by something like:
A3D = reshape(cropVol,[128 128 1463]);
If you want or need to re-arrange the for dimensions (of still unknown meaning to us since you still will not tell us what they signify.) you can do that with the permute function. This is the only way to put all elements of an array with dimensions [176 224 152 4] into an N-by-N-by-M array, since the total number of elements factor into: 2^14 * 7 * 11 * 19.

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!

Translated by