How to find the best fit curve as a vertical scaling of another curve?
2 ビュー (過去 30 日間)
古いコメントを表示
I have a original graph of function f(x). Now I have few points scattered and I want to find a best fit curve through these points. But my new fit curve should be of the form n*f(x) where n is a numerical value. I want to find the value n. How can I do this? Below figure might explain the problem I am talking about. I want to fit curve n*f(x) through orange points and find out n. ![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/744504/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/744504/image.png)
0 件のコメント
採用された回答
David Goodmanson
2021 年 9 月 20 日
編集済み: David Goodmanson
2021 年 9 月 20 日
Hi SojM,
Suppose you have points x,y for the function f(x), where x and y are column vectors. And suppose the red points are the set xr,yr, also both column vectors. Then
ynew = interp1(x,y,xr,'spline');
n = ynew\yr
If you have f(x) as an algebraic function, then the first line can be simply
ynew = f(xr)
その他の回答 (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!