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 Comment

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.

Sign in to comment.

 Accepted Answer

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 Comment

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?

Sign in to comment.

More Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!