How to resize a 4D Matrix

22 次查看(过去 30 天)
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!!!!

采纳的回答

Rik
Rik 2019-9-24
编辑:Rik 2019-9-24
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)

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Read, Write, and Modify Image 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by