sum in sequence, string, matrix

7 ビュー (過去 30 日間)
Nikola Ostojic
Nikola Ostojic 2021 年 1 月 16 日
コメント済み: Star Strider 2021 年 1 月 16 日
I have a 1x8760 matrix (hours per year). I need to add up 24h and make a 1x365 or 365x1 matrix.
example: sum of values ​​1-24 in 1x1
sum of values ​​25-48 in 1x2 ..

採用された回答

Star Strider
Star Strider 2021 年 1 月 16 日
Try this:
M = 1:8760; % Create Vector
Mr = reshape(M, 24, []); % Reshape Vector
MeanMr = mean(Mr); % Take Column Means
.
  3 件のコメント
Star Strider
Star Strider 2021 年 1 月 16 日
Sorry. I misread your Question. Replace mean with sum. They operate the same way.
Star Strider
Star Strider 2021 年 1 月 16 日
As always,. my pleasure!

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

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by