Mean column with step
1 次查看(过去 30 天)
显示 更早的评论
I have a column vector of n elements, i would like to calculate the mean with a step of 10 (the mean of 10th, 20th, and so on). thanks
0 个评论
采纳的回答
更多回答(1 个)
Matt J
2018-8-28
编辑:Matt J
2018-8-28
Assuming n is a multiple of 10 (otherwise you should pad the vector), you can use SEPBLOCKFUN (Download),
out = sepblockfun(theVector,[10,1],'mean')
1 个评论
Matt J
2018-8-28
tiffani commented
I think this is not my aim, the output will be a simple number, which is the mean each 10th elements in the vector, with this function sepblockfun i get a vector as output
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Statistics and Machine Learning Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!