conversion of daily cell into monthly cell.

1 回表示 (過去 30 日間)
pruth
pruth 2016 年 10 月 25 日
編集済み: Andrei Bobrov 2016 年 10 月 25 日
hi,for me this is little hard to explain please try to understand have created on the cell.(attached) it contains hourly wind data (direction and speed) against each day.
<24x2 double> 736055
<24x2 double> 736056
<24x2 double> 736057
<24x2 double> 736058
now I want to create a cell which will contain hourly wind data (direction and speed) against each month.
I don't want to average. I want to append wind data after each 24 hours for each month.
i hope you understand
  1 件のコメント
Alexandra Harkai
Alexandra Harkai 2016 年 10 月 25 日
How would the output look like?

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

採用された回答

Andrei Bobrov
Andrei Bobrov 2016 年 10 月 25 日
編集済み: Andrei Bobrov 2016 年 10 月 25 日
[Y,M] = datevec([day_wise_wind_chembur{:,2}]');
[a,~,c] = unique([Y,M],'rows');
out = [num2cell(a,2),...
accumarray(c,(1:numel(c))',[],@(ii){cell2mat(day_wise_wind_chembur(ii,1))})];

その他の回答 (1 件)

Marc Jakobi
Marc Jakobi 2016 年 10 月 25 日
編集済み: Marc Jakobi 2016 年 10 月 25 日
Use vertical concatenation.
month = [day1; day2; day3; ...; day31];
% day1 through day31 would be the variables containing the 24x2 doubles
To store the months in the cell array
C{1} = [day1; day2; day3; ...; day4];

カテゴリ

Help Center および File ExchangeDates and Time についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by