Code covered by the BSD License  

Highlights from
Fit experimental data is easy

3.66667

3.7 | 3 ratings Rate this file 23 Downloads (last 30 days) File Size: 5.81 KB File ID: #10625
image thumbnail

Fit experimental data is easy

by Jean-Luc Dellis

 

03 Apr 2006 (Updated 26 Nov 2009)

pbest=easyfit(x,y)

| Watch this File

File Information
Description

pbest=EASYFIT(x,y,varargin)

 fits the data Y = f(X) to a model function Y = FUN(P,X).
If FUN is not given as an input argument, POLYFIT is used as the model function.
Bounds on the parameters P may be set.
By default a plot is generated which presents the data as well the "best" curve, confidence intervals for data% and the uncertainties for the parameters. For programmatic purposes, this graphical mode can be switched off.

MATLAB release MATLAB 7 (R14)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (7)
05 Apr 2006 Duane Hanselman

>> help easyfit does not provide anything helpful. No description of input arguments. No error checking. Does not add value. Please consider removing this file or make signficant changes to it so it is useful and helpful.

11 Apr 2006 Jean-Luc Dellis

Whithout response of Duane Hanselman to my email, I place it here:
>>help easyfit does not provide anything helpful.

This has been corrected.

>>Does not add value. Please consider removing this file or make signficant changes to it so it is useful and helpful.

Yes, there is no original or complex algorithm (the code itself takes exactly 7 lines!), just a useful application of nested functions as described by the Matlab Help itself. From this point of view Duane is right.
But, with its simplicity and the given examples, easyfit can be a great help for users who whish to fit experimental data and are not experts (as Duane) in Matlab.

08 Jun 2006 gok gok

i'm a new to this process.
need more info: what are pinit, fhandle for?

27 Jul 2006 Tie Ling

I am a new user of Matlab. I will apply the mathematical model by using Matlab to match my experiment. This is very useful for me! Thank you very much!
Another question is: do you have some other example to show how to modify mathematical parameters to better match experiment data? I really need it!
Thanks again!

27 Jul 2006 Tie Ling

I am a new user of Matlab. I will apply the mathematical model by using Matlab to match my experiment. This is very useful for me! Thank you very much!
Another question is: do you have some other example to show how to modify mathematical parameters to better match experiment data? I really need it!
Thanks again!

25 Feb 2008 Phil Wissgott

good work, but comments are suboptimal. LB and UB have to be the same size as pinit not x0(notation mismatch).
Thank you for your effort
Phil

04 Apr 2008 Jean-Luc Dellis

Hello all, that function can only handle REAL vectors X and Y. EASYFIT is like NLFIT from the stats tool box, but easier to use for not-expert-in-matlab. Have a look on the given examples. Regards.

Please login to add a comment or rating.
Updates
05 Apr 2006

Help lines misplaced

11 Apr 2006

a) options set by OPTIMSET can be handled

b) fval the value of the function DISTANCE can be returned by EASYFIT

08 May 2006

It is now possible to set constraints on the parameters of the model-function. This was realized in using FMINSEARCHBND (from file exchange, author: John D'Errico).

31 Mar 2008

- put VARARGIN to simplify the use
- put UNCERTAINTIES as a subfunction to compute them as
well the data confidence intervals

26 Nov 2009

Fix minor points and add an example where one parameter is hold constant in fitting.

Tag Activity for this File
Tag Applied By Date/Time
optimization Jean-Luc Dellis 22 Oct 2008 08:21:21
experimental data Jean-Luc Dellis 22 Oct 2008 08:21:21
curve Jean-Luc Dellis 22 Oct 2008 08:21:21
fit Jean-Luc Dellis 22 Oct 2008 08:21:21
uncertainties Jean-Luc Dellis 22 Oct 2008 08:21:21

Contact us at files@mathworks.com