How to find x value for a given y?
22 ビュー (過去 30 日間)
古いコメントを表示
I am trying to find the x value for a specific y value, from a fit. My first guess into how to solve this was:
xval = fzero([cfit - y], x0);
However this does not work as cfit do not recognize the - sign.
Is there a way to alter the coefficients of the fit I have? Alternatively, is there a simpler function that can be used?
Thanks in advance.
0 件のコメント
回答 (1 件)
darova
2020 年 4 月 8 日
Here is an example:
f = @(x) sin(x);
x = 0:10;
x0 = fzero(@(x)f(x)-0.5,pi);
plot(x0,f(x0),'or')
line(x,f(x))
If you have more parameters use thi
x0 = fzero(@(x)f(a,b,x)-0.5, pi);
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Interpolation についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!