Curve smoothing / fitting

1 visualización (últimos 30 días)
Latifa Bouguessaa
Latifa Bouguessaa el 25 de Jul. de 2022
Comentada: Latifa Bouguessaa el 26 de Jul. de 2022
Hi guys,
I need your help again.
how can i smooth or fitting my curve?
Many Thanks

Respuestas (1)

the cyclist
the cyclist el 25 de Jul. de 2022
Do you mean you want a smooth line that goes through all the points? You could fit a spline:
% Set seed for reproducibility
rng default
% The data
x = 1:6;
y = rand(size(x));
% Fit a spline
xq = 1:0.1:6;
s = spline(x,y,xq);
% Plot
figure
plot(x,y,"ko",xq,s,"r--")
If you mean you want to fit some functional form (like maybe a square wave?) to the data, you'll need to give us more info. Also, uploading the data will help.
  3 comentarios
the cyclist
the cyclist el 26 de Jul. de 2022
Unfortunately, I can't run your code, because I don't have the Image Processing Toolbox.
Latifa Bouguessaa
Latifa Bouguessaa el 26 de Jul. de 2022
:-(

Iniciar sesión para comentar.

Categorías

Más información sobre Interpolation 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