interpolation 3+ variables and a datavector..

Hi all I really need some help, with this little problem. :-)
I simply just need a way to make a linear/cubic interpolation in 3+ data variables (x,y,z,...) and get a interpolated result from another vector (r)
I've tried interpn and griddatan, but i couldn't get it to work..
lookup_point=[0.65,1,0.03]
x = 0.6000 0.2000 0.3000 0.5000 0.3000 0.6000 0.7000
y = 2 2 3 1 1 1 1
z = 0.1500 0.0200 0.0200 0.0300 0.0300 0.0200 0.0500
r = 222 333 442 324 532 100 200

 Réponse acceptée

Sean de Wolski
Sean de Wolski le 4 Déc 2013
%Data
x = [0.6000 0.2000 0.3000 0.5000 0.3000 0.6000 0.7000]
y = [2 2 3 1 1 1 1]
z = [0.1500 0.0200 0.0200 0.0300 0.0300 0.0200 0.0500]
r = [222 333 442 324 532 100 200]
lookup_point=[0.65,1,0.03]
% Build interpolant
SI = scatteredInterpolant(x',y',z',r')
SI(lookup_point) %use it

1 commentaire

thomas
thomas le 4 Déc 2013
Nice! What if I would like a cubic interpolation?

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Interpolation dans Centre d'aide et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by