MATLAB Answers

0

how can I plot smooth graph

Asked by Md Mostofa Haider on 14 Mar 2019
Latest activity Commented on by Md Mostofa Haider on 17 Mar 2019
I do have much noise in the data from a test. So my graph doesn't look good. y axis data are consistent however x axis data have fluctuation. How can I smooth the graph like the black graph in the picture keeping the maximum value of y in matlab?
Test.jpg

  1 Comment

I think there is a seperate tool; box for this purpose(Curve Fitting Toolbox). Check it out.

Sign in to comment.

1 Answer

Answer by Arvind Sathyanarayanan on 14 Mar 2019

A moving average filter might do the job. Play around with the number of points to preserve the peak value.
N = 10;
h = (1/N)*ones(1,N);
filtered = conv(orginal, h);
filtered = filtered(N:end);

  1 Comment

Thanks. It worked for me.

Sign in to comment.