Effacer les filtres
Effacer les filtres

interpolation of 3d matrix in only one dimention

4 vues (au cours des 30 derniers jours)
Keren Grinberg
Keren Grinberg le 14 Avr 2022
Modifié(e) : Matt J le 14 Avr 2022
i have 4X49X49 matrix B, i want to use interpolate the first dimantion with spline interpolation to get 49X49X49 matrix.
from doing that:
A=interp(B,4,'spline')
X=A(:,1:16:end,:);
X2=X(:,:,1:16:end);
i got the matrix i want but the next thing that i want to do is to interpolate using 'linear' in Y direction so i want to learn how i can do different interpolations to different dimantions.
thanks

Réponses (1)

Matt J
Matt J le 14 Avr 2022
Modifié(e) : Matt J le 14 Avr 2022
permute the array using permute() or shiftdim() so that the desired dimension becomes the first dimension.
C=interp(shiftdim(A,1),4,'linear');
C=shiftdim(C,-1);

Catégories

En savoir plus sur Interpolation 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