Moving Mean Function - How to apply
    4 Ansichten (letzte 30 Tage)
  
       Ältere Kommentare anzeigen
    
    Dario Walter
      
 am 1 Jun. 2019
  
    
    
    
    
    Kommentiert: Dario Walter
      
 am 1 Jun. 2019
            Hey guys,
I want to create a moving average with window size 4 as depicted below (take last 4 entries and in the beginning the highest number of entries available). 
Unfortunately I do not get along with the "movmean" function. Can anyone help me?
Val    MovAvg
1        1
2        1,5
3        2
4        2,5
5        3,5
6        4,5
7        5,5
8        6,5
0 Kommentare
Akzeptierte Antwort
  Guillaume
      
      
 am 1 Jun. 2019
        movmean(yourvector, [3, 0], 'Endpoints', 'shrink');  %3 values backward (plus current value), 0 forward. Shrink at edges (beginning only since only looking backward)
Weitere Antworten (0)
Siehe auch
Kategorien
				Mehr zu Parallel Computing finden Sie in Help Center und File Exchange
			
	Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
