Borrar filtros
Borrar filtros

How to resize a 4D Matrix

22 visualizaciones (últimos 30 días)
Sriparna Sen
Sriparna Sen el 24 de Sept. de 2019
Comentada: Sriparna Sen el 24 de Sept. de 2019
I want to resize a 4D matrix with the following dimensions (238,87,60,69) to a 4D matrix with the following dimensions (238,58,40,46).
I tried using the function 'imresizen' as follows:
vtc = xff('DX.vtc');
vtc1 = vtc.VTCData; %vtc.VTCData has the following dimensions (238,87,60,69)
vtc2 = imresizen(vtc1,[238,58,40,46]);
However, I get the following error message:
Error using griddedInterpolant/subsref
Requested 56644x5046x2400x3174 (8111094.2GB) array exceeds maximum array size preference. Creation of arrays greater
than this limit may take a long time and cause MATLAB to become unresponsive. See array size limit or preference
panel for more information.
Error in imresizen (line 71)
Y=reshape(F(yvec),szy);
Is there a way to resize the 4D matrix using another method? Or am I using 'imresizen' incorrectly?
Thank you so much in advance!!!!

Respuesta aceptada

Rik
Rik el 24 de Sept. de 2019
Editada: Rik el 24 de Sept. de 2019
You misunderstood the syntax of the FEX submission imresizen. The second input is a scaling factor, meaning your syntax should look like this:
img4D=rand(238,87,60,69);
wanted_size=[238,58,40,46];
out=imresizen(img4D,wanted_size./size(img4D));
clc,size(out)
  1 comentario
Sriparna Sen
Sriparna Sen el 24 de Sept. de 2019
Oh, thank you so much!!! Make perfect sense now! Cheers

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Read, Write, and Modify Image en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by