How can I make logaritmic fitting like polyfit function

21 visualizaciones (últimos 30 días)
Dogan Arik
Dogan Arik el 19 de Oct. de 2018
Comentada: Dogan Arik el 22 de Oct. de 2018
Hi;
I want to make logaritmic fitting but I don't find any logfit function like polyfit. Is there any function,script etc. that make logaritmic curve fitting in matlab
-edit- (19.10.2018 - 15:20)
I want to this type of curve fitting.
  1 comentario
Walter Roberson
Walter Roberson el 19 de Oct. de 2018
Could you give an example of what a multi-term model might look like?

Iniciar sesión para comentar.

Respuesta aceptada

Torsten
Torsten el 19 de Oct. de 2018
Fit log(x) against y using a linear polynomial in "polyfit". What's the problem ?
  6 comentarios
Torsten
Torsten el 22 de Oct. de 2018
Editada: Torsten el 22 de Oct. de 2018
x are your input data, y are your output data in both suggestions.
If you have matrices of input and output data, make them to vectors by using
x = x(:);
y = y(:);
Best wishes
Torsten.
Dogan Arik
Dogan Arik el 22 de Oct. de 2018
I have not problem with convert matrices to vectors.
fun = @(p,x) p(2)*exp(p(1)*x);
p0 = [1, 1];
p = lsqcurvefit(fun,p0,x,y)
yfit = fun(p,x);
plot(x,y,x,yfit)
I change my code according second code you suggest, then it solves my problem .
Thanks for all thing;

Iniciar sesión para comentar.

Más respuestas (0)

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