How can I plot points on a graph along with the smoothed values?

I am able to plot points on a graph, but when I apply smoothing I am unable to plot the same points in my graph.
I tried to use filters and also tried changing span values. Is there any other way to plot points on a non-linear graph?

1 commentaire

I am assuming that you have the original data and smoothed data and are just trying to plot it. If not, please clarify the question.

Connectez-vous pour commenter.

 Réponse acceptée

You want to plot them both, either using hold on between plots, or in the same plot command.
original_x = [1.0 2.0 3.0];
original_y = [4.0 5.1 6.0];
smoothed_x = [1.0 1.5 2.0 2.5 3.0]; %get these how you want
smoothed_y = [4.0 4.5 5.0 5.5 6.0]; %get these how you want
plot(original_x, original_y, 'ro', smoothed_x, smoothed_y, 'b-')

1 commentaire

I need to plot points from .csv file. I need to smooth the waveform first and plot the points. have you got any solution to smooth waveform and plot on the actual waveform?

Connectez-vous pour commenter.

Plus de réponses (0)

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by