How to reshape in 3D a downsampled matrix

3 ビュー (過去 30 日間)
Tahariet Sharon
Tahariet Sharon 2020 年 4 月 24 日
コメント済み: Turlough Hughes 2020 年 4 月 24 日
Let's say I have this data:
factor=2;
data=zeros(40,20,74);
data(1:factor:end,1:factor:end,1:factor:end)=1;
Now, I would like to get a new "data" matrix just retaining the values "ones".
Thanks in advance,
TS

採用された回答

Turlough Hughes
Turlough Hughes 2020 年 4 月 24 日
Easiest thing to do would be just this:
newData = data(1:factor:end,1:factor:end,1:factor:end);
  1 件のコメント
Turlough Hughes
Turlough Hughes 2020 年 4 月 24 日
You might find the methods in the imresize function to be useful.

サインインしてコメントする。

その他の回答 (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