필터 지우기
필터 지우기

How to resize a 4D Matrix

조회 수: 22 (최근 30일)
Sriparna Sen
Sriparna Sen 2019년 9월 24일
댓글: Sriparna Sen 2019년 9월 24일
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)
  댓글 수: 1
Sriparna Sen
Sriparna Sen 2019년 9월 24일
Oh, thank you so much!!! Make perfect sense now! Cheers

댓글을 달려면 로그인하십시오.

추가 답변 (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