equation solver - how to solve in matlab

2 ビュー (過去 30 日間)
Duncan
Duncan 2011 年 4 月 14 日
I'd like to find the curve of the form
y = a + (b - a)/(1 + (x/c)^ d))
to fit experimental data. I can do this in excel using solver by getting it to minimise the residuals between the curve and experimental data. Is this possible in Matlab without the optimistaion toolbox?
Any suggestions appreciated

採用された回答

Abhishek Gupta
Abhishek Gupta 2011 年 4 月 14 日
Hi Duncan,
You can perform basic curve fitting using the optimization routines available in MATLAB.
Search for "Optimal Fit of a Non-linear Function" in the documentation to find a published version of a demo. This demo shows how one may use FMINSEARCH to achive this objective. You may also open the demo in MATLAB editor by executing:
>> edit fitdemo
Hope this helps.
Abhi...
  1 件のコメント
Duncan
Duncan 2011 年 4 月 15 日
Worked a treat! Thanks

サインインしてコメントする。

その他の回答 (1 件)

Andrew
Andrew 2011 年 8 月 10 日
Hi, I have a similar problem. To simplify assume a linear equation y=mx+c. I have values for the independent variable x, the actual y and want to solve for coefficients m and c. Using Excel Solver I would use random initial values for m and c in my equation, and get a fitted y, say y_fit. Then work the sum of squared residuals between y and y_fit [RSS = sum((y-yfit)^2)]. Then tell Solver to give me a solution for m and c which minimises RSS. Is this possible in Matlab? Can I make use of the Optimisation tool box to do this?
Thanks
  1 件のコメント
Duncan
Duncan 2011 年 8 月 11 日
Hi Andrew, try the answer above submitted by Abhishek. That worked well for me

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeLeast Squares についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by