griddata interpolation 3 variables, determine mid values

3 次查看(过去 30 天)
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 ?

回答(1 个)

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

类别

Help CenterFile Exchange 中查找有关 Interpolation 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by