필터 지우기
필터 지우기

Solving for an x value using ppval

조회 수: 2 (최근 30일)
David Hagan
David Hagan 2012년 1월 3일
I have created a linear piecewise function using interp1 which works beautifully given the x value. Is there a way for which I could solve for an x value given the Y value? Example:
hotStreamInterp = interp1(B,Hhotpt, 'linear', 'pp')';
x = fsolve(480 = ppval(hotStreamInterp, x_unknown));
How could I properly write this? Thank you.

채택된 답변

Andrew Newell
Andrew Newell 2012년 1월 3일
It depends - if x and y are 1-1, you can just switch them in the above two lines. In general, however, there is probably more than one x value for a given y value. Then you'll have to decide whether you want x from a particular interval or all the values of x. If you know where the extrema in x are, you could interpolate in the intervals between extrema.
  댓글 수: 1
David Hagan
David Hagan 2012년 1월 3일
Indeed they were 1-1...thank you very much.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

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