If a have this matrix:
A=[1:1:100]
B=[101:1:200]
M=[A(:), B(:)]
I need to add 20 columns to M which contain the summation of A values like:
C = summation of the row |i| + the row |i-1|,
D = summation of the row |i| + the row |i-1|+|i-2|,
E = summation of of the row |i| + the row |i-1|+|i-2|+|i-3|,.. etc
and M=[A(:), B(:), C(:), D(:), E(:) ...etc]
For example: it would be something like:
A B C D E.. etc -> until 20
1 101 1 1 1
2 102 3 3 3
3 103 5 6 6
4 104 7 9 10
5 105 9 12 14
6 106 11 15 18
7 107 13 18 22
8 108 15 21 26
9 109 17 24 30
10 110 19 27 34
11 111 21 30 38
12 112 13 33 42
. . . . .
. . . . .
. . . . .
etc etc etc etc etc ...
2 件のコメント
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/378621-how-to-add-columns-of-accumulated-sum-in-a-matrix#comment_527784
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/378621-how-to-add-columns-of-accumulated-sum-in-a-matrix#comment_527784
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/378621-how-to-add-columns-of-accumulated-sum-in-a-matrix#comment_527787
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/378621-how-to-add-columns-of-accumulated-sum-in-a-matrix#comment_527787
サインインしてコメントする。