How to use curve fitting toolbox automatically deal with curves?

4 Ansichten (letzte 30 Tage)
Ming
Ming am 12 Aug. 2014
Kommentiert: Pratik Bajaria am 14 Aug. 2014
I get a group of data,Here I attached.and I just want to know how to do it automatically instead of curve fitting one curve for once time.who can give me some advice? or tell me how to write a code for this.Additional I get one function for these curves ,but I don't know how to confirm the initial value.Function is f(x)=a+b/(1+(d*x)^c)

Antworten (1)

Pratik Bajaria
Pratik Bajaria am 13 Aug. 2014
That's True! Even I can't find attachment. Irrespective of that, if you would like to do curve fitting via command line, you can go through the following. http://www.mathworks.in/help/curvefit/fit.html http://www.mathworks.in/help/matlab/ref/polyfit.html and the related functions too. I guess, this is what your question is. 'To run it directly from Matlab command prompt, rather than by conventional 'cftool' and processing and stuff'. Correct me if i am wrong.
Hope this helps!
Regards, Pratik
  3 Kommentare
Pratik Bajaria
Pratik Bajaria am 14 Aug. 2014
Well it's simple.
A 4 step process. 1. Read the excel into MATLAB using 'xlsread' function. 2. use fit function to fit y1 and time. 3. Use a for loop to span through all the columns. 4. Keep running and save them in a Cell or Structure in MATLAB until the last column and that's it.
Go though the example on the site it will be easier.
Regards, Pratik
Pratik Bajaria
Pratik Bajaria am 14 Aug. 2014
For example,
[num,text,raw]=xlsread('m1.xlsx');
x=num(1:398,1);
y=num(1:398,2);
cf=fit(x,y,'smoothingspline');
cf
This works just fine for one set of data. Now we can run a for loop in order to get the fits for other sets in the excel sheet. Then it can be stored in a MATLAB cell, like '*cfs{1}=cf*'.
Hope it helps.
Regards, Pratik

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Get Started with Curve Fitting Toolbox finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by