Fitting to an exponential function from row datas

1 visualización (últimos 30 días)
friet
friet el 4 de Jun. de 2017
Respondida: Star Strider el 4 de Jun. de 2017
I have a function y dependent on t. I want to fit it to a function of y=a*exp(-b/t) and determine the variables "a" and "b". I write the code below, however, it didn't converge. Any help is appreciated.
Thanks GH
clear all
clc
Data=[300.0092 2.2742e-16
331.0053 2.1617e-15
335.0210 3.0675e-15
361.2484 4.3307e-14];
t = Data(:,1);
y = Data(:,2);
plot(t,y,'ro')
title('Data points')
F = @(x,xdata)x(1)*exp(-x(2)*xdata);
x0 = [10^-16 0.001];
[x,resnorm,~,exitflag,output] = lsqcurvefit(F,x0,t,y)
hold on
plot(t,F(x,t))
hold off

Respuestas (1)

Star Strider
Star Strider el 4 de Jun. de 2017
It appears to with:
x0 = [1E-15 -0.1];

Categorías

Más información sobre Interpolation en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by