How to reshape in 3D a downsampled matrix

3 visualizaciones (últimos 30 días)
Tahariet Sharon
Tahariet Sharon el 24 de Abr. de 2020
Comentada: Turlough Hughes el 24 de Abr. de 2020
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

Respuesta aceptada

Turlough Hughes
Turlough Hughes el 24 de Abr. de 2020
Easiest thing to do would be just this:
newData = data(1:factor:end,1:factor:end,1:factor:end);
  1 comentario
Turlough Hughes
Turlough Hughes el 24 de Abr. de 2020
You might find the methods in the imresize function to be useful.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Resizing and Reshaping Matrices en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by