creating a scatter plot with smooth line for small dataset

2 visualizaciones (últimos 30 días)
I have a small dataset like this: x = [1 2 3 4 5]; y = [0.1 0.5 0.3 0.7 0.2];
I would like to plot them with a smooth line (not a straight line) like what we can do in Excel. Which command can do this?
Thanks in advance

Respuesta aceptada

Birdman
Birdman el 15 de Feb. de 2018
Use spline.
xq=1:0.01:5;
s=spline(x,y,xq);
plot(x,y,'o',xq,s,'-')

Más respuestas (0)

Categorías

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