How to do curve fitting by a user defined function
Show older comments
Hi all,
I am trying to use the process of curve fitting via a user defined function/code I wrote ( using MATLAB) to extroplate values from an experimental data shown Beolw ( in bold). Any assistance would be greatly appreciated.
My User defined function
parametersused for my code:
Kb=1.38e-23;Ps=0.89;Wb=1.2765104e+7;Vo=1.00e-13;V=1.00e-26;sigma=0.05;mu=0;
t=logspace(log10(0.00000226),log10(2),50);
D=@(V,t)(1./(V.*sigma.*sqrt(2.*pi)).*exp(-log(V)-mu).^2/(2.*sigma^2)).*(2*Ps.*(1-exp(-(t)./(Vo*exp((Wb-Ps*11300000)*V/(Kb*80))))));
>> s= arrayfun(@(t) integral(@(V) D(V, t)/(2e+55*Ps), 0.85e-26, 1.15e-26), t);
>> plot(log(t),s2)
Above code wouold generate a curve, which I intend to curve fit with the data from experiment below....
Data from experiment
>> x1=[-6.7 -6.5 -6.3 -6.1 -5.9 -5.7 -5.5 -5.3 -5.1 -5 -4.7 -4.5 -4.3 -4 -3.7 -3.5 -3.3 -3.1];
>> y1=[0.06 0.09 0.1 0.12 0.14 0.18 0.22 0.28 0.34 0.38 0.5 0.58 0.62 0.68 0.72 0.73 0.75 0.77];
>> plot(x1,y1)
1 Comment
Oliver
on 28 Sep 2022
Wow very cool sir
Accepted Answer
More Answers (1)
Mudaga Andrew Nomuoja
on 8 Jun 2021
0 votes
Categories
Find more on Get Started with Curve Fitting Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
