summing columns based on certain interval
古いコメントを表示
hi
I need your help with summing columns based on certain interval
I could not find a solution already discussed. I have a matrix of size 153×10
I need to split the sum in 3 parts
the first part is the first 51 lines
the second is from line 53 to 102
the third sum is from line 104 to 153
thank you in advance
採用された回答
その他の回答 (1 件)
Torsten
2021 年 5 月 24 日
0 投票
sum(sum(A(1:51,:)))
sum(sum(A(53:102,:)))
sum(sum(A(104:153,:)))
3 件のコメント
umberto kober
2021 年 5 月 24 日
the cyclist
2021 年 5 月 24 日
FYI, in R2018b or later, one could instead do
sum(A(1:51,:),'all')
and so on, rather than applying the sum() twice.
umberto kober
2021 年 5 月 24 日
カテゴリ
ヘルプ センター および File Exchange で Cell Arrays についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!