How to convert a quarterly data to annual data

4 ビュー (過去 30 日間)
Nguyen Bao
Nguyen Bao 2015 年 11 月 22 日
コメント済み: Mohammad Abouali 2015 年 11 月 23 日
Hello, I am working on quarterly time-series data, got some results and now I would like to convert them to annual series. For example, 2013q1 2013q2 2013q3 2013q4 2014q1 2014q2 2014q3 2014q4 ...now I would see the series: 2013 and 2014 where 2013 = sum{2013q1 2013q2 2013q3 2013q4}... I tries "convertto" but it did not work. Thanks you very much.
Bao

採用された回答

Mohammad Abouali
Mohammad Abouali 2015 年 11 月 23 日
編集済み: Mohammad Abouali 2015 年 11 月 23 日
Assuming all years have all 4 quarters (no missing quarter) in row or column vector, i.e.:
quarterlyData=[2013q1 2013q2 2013q3 2013q4 2014q1 2014q2 2014q3 2014q4 ....]
or
quarterlyData=[2013q1; 2013q2; 2013q3; 2013q4; 2014q1; 2014q2; 2014q3; 2014q4; ....]
then you can calculate yearly as follow:
yearlyData= sum( reshape(quarterlyData,4,[]) );
  2 件のコメント
Nguyen Bao
Nguyen Bao 2015 年 11 月 23 日
Great, I got it. Thank you very much Mohammad Abouali.
Mohammad Abouali
Mohammad Abouali 2015 年 11 月 23 日
You are welcome.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangePower and Energy Systems についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by