How to reshape in 3D a downsampled matrix

3 vues (au cours des 30 derniers jours)
Tahariet Sharon
Tahariet Sharon le 24 Avr 2020
Commenté : Turlough Hughes le 24 Avr 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

Réponse acceptée

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

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Resizing and Reshaping Matrices dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by