Create loop to extract mean of every 100 values
2 次查看(过去 30 天)
显示 更早的评论
Hi,
I have an array, 24000 X 31.
Is there a way of writing a for loop that can take every row of the array to create 31 rows each with 24000 values and then take the mean average of every 100 values in each row. The result should hopefully be 31 separate arrays each with 240 values.
Thanks in advance, Ed.
0 个评论
回答(1 个)
David Hill
2022-2-3
newMatrix=reshape(mean(reshape(yourMatrix,100,[])),240,[]);%columns are each array
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!