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에서 Surface and Mesh Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!