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 CenterFile Exchange에서 Multirate Signal Processing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by