Clear Filters
Clear Filters

average of n values of a dataset in a reverse direction (bottom to up )by using rolling or sliding window ????

2 views (last 30 days)
Hi, i have one query i have dataset of one column and i want to take average of every n values in a reverse direction (bottom to up) by using rolling/sliding window. can you please help me how can i do that
thanks

Answers (1)

KSSV
KSSV on 8 May 2018
n = 100 ;
idx = 1:n ;
A = fliplr(idx) ;
nt = 5 ; % every nth value average
ind = reshape(1:n,nt,[])' ;
A(ind)
To get average use mean. Read about mean

Products

Community Treasure Hunt

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

Start Hunting!