Interpolate a 4D matrix to increase its size
Show older comments
Hi!
i have a 4D matrix B its size is 40*64*40 and i want to increase it to be 250*400*250 ,i know that if we multiplie the first size with 6.25 we will get the final size that we want, i know i should use the interp3 for that ,i tried it i did [X,Y,Z]=size(B);
V=6.25*size(B1);
[Xq,Yq,Zq]=[250 400 250];
B1=interp3(X,Y,Z,V,Xq,Yq,Zq);
But it dosen't work . please can any one help me with that ? specialy that i am not used to work with 4D matrix ,I used to use imresize() for 2D matrix!!
thank you so muchh
4 Comments
Jan
on 26 Apr 2019
A "4D" matrix should have 4 dimensions, not 3. I assume, you mean a "3D array".
"It doesn't work" is a lean description of what happens. Please mention, what you observe and what you want instead.
rachida
on 29 Apr 2019
Stephen23
on 29 Apr 2019
"i have a 4D matrix B its size is 40*64*40"
That is a 3D array (unless you are bothering to arbitrarily count one implicit trailing singleton dimension). Why do you keep insisting that an array with three consecutive non-singleton dimensions is a "4D matrix" ?
rachida
on 29 Apr 2019
Accepted Answer
More Answers (2)
Matt J
on 26 Apr 2019
B1=imresize3(B,[250,400,250]);
3 Comments
rachida
on 29 Apr 2019
rachida
on 29 Apr 2019
The documentation of imresize claims, that "any dimension" is handled, but some tests show, that this concerns 2D gray-scale images and [X * Y * N] arrays only, while for the later only the 1st 2 dimensions are scaled and the last one is treated as color channels.
If your data truly does have 4 dimensions, then you can use imresizen
B1=imresizen(B,[6.5,6.5,6.5,1]);
Categories
Find more on Interpolation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!