3D Matrix extraction and manipulation

1 次查看(过去 30 天)
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).

采纳的回答

Star Strider
Star Strider 2020-7-3
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.
.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Resizing and Reshaping Matrices 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by