How to fit this curve?

1 visualización (últimos 30 días)
Gabriel Costa
Gabriel Costa el 28 de Feb. de 2021
Comentada: Star Strider el 28 de Feb. de 2021
x = [39.224 49.03 58.836 68.642 78.448 88.254 98.06 107.866 117.672 127.478 137.284];
y = [2.4218 3.9931 6.0817 8.7791 12.1994 16.4867 21.8260 28.4584 36.7052 47.0032 59.9637];
  3 comentarios
Gabriel Costa
Gabriel Costa el 28 de Feb. de 2021
Thanks!
Tatti Singh
Tatti Singh el 28 de Feb. de 2021
Thanks for the help. I was looking the same.

Iniciar sesión para comentar.

Respuesta aceptada

Star Strider
Star Strider el 28 de Feb. de 2021
The best model is the mathematical expression of the process that created those data.
A power law fit appears to provide a reasonable approximation:
x = [39.224 49.03 58.836 68.642 78.448 88.254 98.06 107.866 117.672 127.478 137.284];
y = [2.4218 3.9931 6.0817 8.7791 12.1994 16.4867 21.8260 28.4584 36.7052 47.0032 59.9637];
fcn = @(b,x) b(1).*x.^b(2);
B = fminsearch(@(b) norm(y - fcn(b,x)), rand(2,1)); % Power Law
figure
plot(x, y, '.')
hold on
plot(x, fcn(B,x), '-r')
hold off
grid
xlabel('X')
ylabel('Y')
producing:
.
  2 comentarios
Gabriel Costa
Gabriel Costa el 28 de Feb. de 2021
Thanks!
Star Strider
Star Strider el 28 de Feb. de 2021
As always, my pleasure!

Iniciar sesión para comentar.

Más respuestas (1)

Tatti Singh
Tatti Singh el 28 de Feb. de 2021
Thanks for it.

Categorías

Más información sobre Get Started with Curve Fitting Toolbox en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by