reverse of interpolation.....
古いコメントを表示
I have a function V that is computed from two inputs (X,Y). I am using a grid of points and performing 2d interpolation.
X = [1,2,3];
Y = [1,2,3];
V =[3,4,5;6,7,8;9,10,11];
Is is easy to obtain V for any combination of (X,Y), for example:
Vq = interp2(X,Y,V,1.8,2.5)
Vq = 8.3000
I now want to inverse that function and for fixed V, how one can find respective X, Y?
Thank you in advance.
4 件のコメント
KSSV
2016 年 7 月 5 日
Well, you have your own answer: Use contour for the values you are interested in. There are quite a few algortihms to get isolines. Looking at contour.m does not say much about how it's done so if you want the details you'd have to ask the Mathworks I guess.
John D'Errico
2016 年 7 月 5 日
I added an answer that explains how a contour tool does its job.
採用された回答
その他の回答 (2 件)
José-Luis
2016 年 7 月 5 日
0 投票
Some time ago, contourc() the low-level function on which contour() is based, used to do it through linear interpolation. That might have changed, but since contourc() is a built-in function, the implementation is hidden from the user.
Star Strider
2016 年 7 月 5 日
0 投票
I would experiment with the contour function. You can have contour return the (x,y) coordinates for a specific value or range of values of ‘V’. (This is a common way of determining the zeros of a bivariate function.) See the contour documentation for Display Single Contour Line for details.
Returning the (x,y) coordinates for a specific value of ‘V’ requires that you use the first column for a specific value to determine the value (first row), and the number of (x,y) pairs that contour calculates (second row).
カテゴリ
ヘルプ センター および File Exchange で Interpolation についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!