3D Matrix extraction and manipulation

1 回表示 (過去 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 Center および File ExchangeResizing and Reshaping Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by