フィルターのクリア

Averages of Vectors

1 回表示 (過去 30 日間)
Eric
Eric 2012 年 3 月 5 日
I have a vector of temperature measurements every minute over a day and I need to convert this to a vector of 30 minute averages over the day. Any suggestions of how to do this effectively? Thanks
  1 件のコメント
Oleg Komarov
Oleg Komarov 2012 年 3 月 5 日
Where do you have the timestamp? Is it a two column matrix with first column the timestamp and the second column the measurment?
Please provide a concise example by editing your message and apply formatting.

サインインしてコメントする。

採用された回答

Thomas
Thomas 2012 年 3 月 5 日
Since you have reading one minute apart, you should have 24*40=1440 readings. You need 48 readings, i.e. mean from 1-30, 31-60 etc.. YOu can reshape your actual vector pf readings and find the mean as follows, Suppose A is you vector of 1440 readings
b=reshape(a,30,[]); % this reshapes your vector into 48 vectors
mean(b); % this finds the mean of each
  2 件のコメント
Oleg Komarov
Oleg Komarov 2012 年 3 月 5 日
Clever but not robust.
Jisha
Jisha 2012 年 3 月 5 日
Never thought I could use reshape this way.. :)

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by