Curve fitting to data

2 views (last 30 days)
Emmanouil  Rachoutis
Emmanouil Rachoutis on 23 May 2018
Edited: sloppydisk on 23 May 2018
Hi all!
I would like to find the best fit of the curve that you can see in the picture attached with data from measurements. The curve is described by the equation: A*(1-phi)*heta*exp(-0.67*heta^1.5), where phi is just a known number and heta is a known vector. The only unknown variable is A, the value of which I would like to estimate after the curve fitting.
I've been trying to use gauss1 fit and solve the equation for A but the value of A that I get is not the expected one. Do you have any other ideas?
I thank you in advance!
Cheers, Manolis

Accepted Answer

sloppydisk
sloppydisk on 23 May 2018
Edited: sloppydisk on 23 May 2018
What you are looking for is just a linear fit to your exponential function, you can do this by using the mldivide operator "\".
phi = 2;
n = 100;
theta = (1:n)'/n;
f = (1-phi)*theta.*exp(-0.67*theta.^1.5);
fOfA = @(A) A*f;
measureddata = fOfA(2)+.05*rand(n, 1);
coeff = f\measureddata;
plot(theta, measureddata, theta, coeff*f)

More Answers (0)

Community Treasure Hunt

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

Start Hunting!