3D Matrix extraction and manipulation

2 visualizaciones (últimos 30 días)
mahmoud zemzami
mahmoud zemzami el 3 de Jul. de 2020
Respondida: Star Strider el 3 de Jul. de 2020
Hi Matlab experts,
I have a 3D matrix with size (128x64x1140) corresponding to 128 value of longitude, 64 value of latitude and 1140 value of time. I want to extract a matrix of size (67x64x1140).

Respuesta aceptada

Star Strider
Star Strider el 3 de Jul. de 2020
That can be straightforward or slightly complicated, depending on how you want to do it.
To extract the first 67 rows:
M = rand(128, 64, 1140); % Create Matrix (To Test Code)
Out = M(1:67,:,:);
To interpolate across the rows:
D1 = linspace(1, 128, 67);
Out = interp1((1:128), M, D1);
Both will produce the matrix you requested, however they are not the same.
.

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