how to resample a data from 37 layers to 34 layers?

1 vue (au cours des 30 derniers jours)
Sreeraj R
Sreeraj R le 16 Nov 2021
Commenté : Sreeraj R le 16 Nov 2021
hi
i have a data in the format of 1076x915x37, however for my analysis i need it to be in 1076x915x34. how do i resample the layers in the data?
i tried using resample but didnt quite understand how it worked.

Réponse acceptée

KSSV
KSSV le 16 Nov 2021
Modifié(e) : KSSV le 16 Nov 2021
Read about interpn.
A = rand(1076,915,34) ;
[m,n,p] = size(A) ;
[X,Y,Z] = ndgrid(1:m,1:n,1:p) ;
[Xi,Yi,Zi] = ndgrid(1:m,1:n,linspace(1,p,37)) ;
B = interpn(X,Y,Z,A,Xi,Yi,Zi) ;

Plus de réponses (0)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by