How to interpolate to get two values for one variable?

I have a graph which is ascending in the beginning and will descend afterwards.
Let's say my y-axis is Y, and x-axis is X,
for a certain Y value, it will give two values on the x-axis.
say in this case i set Y to a value of 20, but it only gives me one X value, which is the latter value when the graph is in its descending portion. How do I get the X value for the initial ascending part of the graph?
I did something like this: interp1(Y,X,20)
Kindly advice.. Thanks!

답변 (1개)

John Petersen
John Petersen 2012년 12월 4일
Use the same index for each parameter. If you want to know the values of X for a given value of Y,
yind = (Y==yvalue);
xvalues = X(yind); % values of x that correspond to yvalue

카테고리

도움말 센터File Exchange에서 Aerospace Blockset에 대해 자세히 알아보기

태그

질문:

KH
2012년 12월 4일

Community Treasure Hunt

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

Start Hunting!

Translated by