4-D array to 3-D array

1 visualización (últimos 30 días)
Sophia
Sophia el 1 de Dic. de 2016
Editada: James Tursa el 1 de Dic. de 2016
I have a 4-D array saved in a mat file like
ice_conc_monthly(:,:, year-1978, month) = d;
its is 304*448*37*12, how can i make it 3-D with 304*448*(37*12) size

Respuesta aceptada

James Tursa
James Tursa el 1 de Dic. de 2016
Editada: James Tursa el 1 de Dic. de 2016
E.g.,
x = your 304 * 448 * 37 * 12 array
y = reshape(x,304,448,37*12);
Another possibility if you want those last two dimensions arranged differently is to permute them first. E.g.,
x = your 304 * 448 * 37 * 12 array
z = permute(x,[1 2 4 3]);
y = reshape(z,304,448,37*12);

Más respuestas (0)

Categorías

Más información sobre Matrices and Arrays en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by