3D Matrix extraction and manipulation

조회 수: 2 (최근 30일)
mahmoud zemzami
mahmoud zemzami 2020년 7월 3일
답변: Star Strider 2020년 7월 3일
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에서 Matrices and Arrays에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by