Effacer les filtres
Effacer les filtres

Convert X,Y,Z column data into equally spacing grid of X,Y and corresponding Z

5 vues (au cours des 30 derniers jours)
have column vector X=m*1; Y=m*1; Z=m*1; (with NaN in between)
Want to convert Z data into regular spacing of X and Y; X ( -90 to 90) and Y(-180 to 180) irrespective of range of the column vectors X and Y.
Kindly help! Thanks!
  5 commentaires
Bhowmik.U
Bhowmik.U le 12 Oct 2018
made meshgrid of X and Y [LON LAT]=meshgrip(X,Y); got LON=m*m and LAT=m*m..then?

Connectez-vous pour commenter.

Réponse acceptée

KSSV
KSSV le 12 Oct 2018
Modifié(e) : KSSV le 11 Mar 2022
Let X,Y,Z be your data.
N = 500 ;
xi = linspace(min(X),max(X),N) ;
yi = linspace(min(Y),max(Y),N) ;
[Xi,Yi] = meshgrid(xi,yi) ;
Zi = griddata(X,Y,Z,Xi,Yi) ;
  1 commentaire
Bhowmik.U
Bhowmik.U le 15 Oct 2018
Thanks a lot Sir!...I was going wrong in not using meshgrid before griddata!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Matrices and Arrays 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