Want to use Matlab similar to Solver in Excel

조회 수: 9 (최근 30일)
Krish
Krish 2013년 2월 20일
답변: Alan Weiss 2017년 9월 25일
Hello, I am trying to use MATLAB to do what a solver in excel will be able to. I have a set of data I have collected experimentally (say Xexpt and Yexpt). I would like to use an *user defined non linear equation *( exponential equation relating y as a function of x but with two constants, A and B). I start with an initial guess value for A and B and calculate the corresponding Ycalc for each Xexpt value. I would like to minimize the square root of the sum of the difference in squares by changing the values of A and B. I could do this in excel by using Solver function, that minimizes the Sqrt (Sum (Yexpt^2-Ycalc^2)) by changing A and B. Can someone help me how i could do the same in Matlab ? Thanks in advance.
  댓글 수: 1
guillaume de Guillebon
guillaume de Guillebon 2017년 9월 21일
4.5 years later, but with the same problem. Did you find a solution for your problem ?

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

답변 (2개)

Christoph F.
Christoph F. 2017년 9월 21일
I think you're looking for the fminsearch() function.
Or alternatively something from the curve fitting toolbox.
  댓글 수: 1
Christoph F.
Christoph F. 2017년 9월 22일
lsqnonlin and related functions from the optimization toolbox might also be an option.

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


Alan Weiss
Alan Weiss 2017년 9월 25일
For examples of how to do this with or without an Optimization Toolbox™ license, see Nonlinear Data-Fitting. To use Statistics Toolbox™, see Nonlinear Regression Workflow. Or check out Curve Fitting Toolbox.
Alan Weiss
MATLAB mathematical toolbox documentation

카테고리

Help CenterFile Exchange에서 Solver Outputs and Iterative Display에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by