griddata interpolation 3 variables, determine mid values

1 view (last 30 days)
hi guys. Let say i have 3 variables, X,Y,Z. I got a graph of X(x-axis) , Y (y-axis) for different Z values. Let say Z velues are ; Z=0:2:20; I also got the X and Y values for each Z value. I got X,Y line for each Z. However i need to determine the values of X,Y for different Z values. For example;
for Z=2 i know X and Y values (line 1 )
Z=4 i know X and Y values too. ( line 2)
Z=6 i know ... etc.
but i need to determine X and Y values for Z = 2,5 or let say any value between two known values of Z(e.g Z =5.5 or Z=7.8..)
is there a way to do this ?

Answers (1)

Andrei Bobrov
Andrei Bobrov on 4 Jul 2014
xf = gridedInterpolant(Z,X);
yf = gridedInterpolant(Z,Y);
F = @(z)[xf(z(:)), yf(z(:))];
use function F:
xy = F(2.5);

Categories

Find more on Function Creation in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!