Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

single dimension array smoothing

Status
Not open for further replies.

danielp0

Bioengineer
Jul 4, 2005
7
does anyone know of a quick way that I can smooth a line graph ?

thanks
 
Replies continue below

Recommended for you

You could low-pass filter it. Matlab has many filter design tools, but a simple moving average is often enough:

b=ones(1,n)/n;
smoothed=filter(b,1,rough);

n is the length of your moving average window.
 
This seems to work fine, thanks. I was looking into using mean, but this is quicker.

the only thing I found is that it shifts the data a bit. but that's not really a problem.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor