sum in sequence, string, matrix

1 次查看(过去 30 天)
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.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Characters and Strings 的更多信息

产品


版本

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by