How do I apply a 1-D median filter and a moving average filter to this set of data?

Illustration
aadisingh - 2021-01-08T09:35:58+00:00
Question: How do I apply a 1-D median filter and a moving average filter to this set of data?

data = [ 10000 -1.202118049 14918.95558 -0.919568637 22257.52355 -0.332079504 33205.90052 -0.9507341 49539.73548 -0.311056814 73908.11129 -0.234900899 110263.1829 -0.909766624 164501.1528 0.249091768 245418.5391 -1.649532359 366138.8283 -0.890747269 546240.8915 -0.679462154 814934.3596 -0.546853842 1215796.951 -0.375618783 1813842.07 -0.598653135 2706062.927 0.195205505 4037163.26 0.207519359 6023025.934 0.288909309 8985725.636 -0.138220046 13405764.16 0.113403922 20000000 -1.157502068]; %Paste data in here  

Expert Answer

Profile picture of Neeta Dsouza Neeta Dsouza answered . 2025-11-20

Try medfilt1():
 
 
filteredData = medfilt1(data, windowWidth);


Not satisfied with the answer ?? ASK NOW

Get a Free Consultation or a Sample Assignment Review!