Create loop to extract mean of every 100 values

2 ビュー (過去 30 日間)
Edward Keavney
Edward Keavney 2022 年 2 月 3 日
回答済み: David Hill 2022 年 2 月 3 日
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.

回答 (1 件)

David Hill
David Hill 2022 年 2 月 3 日
newMatrix=reshape(mean(reshape(yourMatrix,100,[])),240,[]);%columns are each array

カテゴリ

Help Center および File ExchangeMultidimensional Arrays についてさらに検索

製品


リリース

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by