3 63→60
source | link

Octave, 6363 60 bytes

@(A)(@(L)sum(triu(A,1)')(1:L)+sum(tril(A,-1))(1:L))(1:min(size(A)))

Try it online!Try it online!

The answer for this matrix:

2   10   10    2    4
9    7    7    2    9
1    7    6    2    4
7    1    4    8    9

is the vector of row sums of its upper triangular part:

20   10   10    2    4
0    70    7    2    9
0    0    60    2    4
0    0    0    80    9

plus the vector of column sums of its lower triangular part:

02    0    0    0    0
9    07    0    0    0
1    7    06    0    0
7    1    4    08    0

which is precisely what my answer is computing.

Octave, 63 bytes

@(A)(@(L)sum(triu(A)')(1:L)+sum(tril(A,-1))(1:L))(min(size(A)))

Try it online!

The answer for this matrix:

2   10   10    2    4
9    7    7    2    9
1    7    6    2    4
7    1    4    8    9

is the vector of row sums of its upper triangular part:

2   10   10    2    4
0    7    7    2    9
0    0    6    2    4
0    0    0    8    9

plus the vector of column sums of its lower triangular part:

0    0    0    0    0
9    0    0    0    0
1    7    0    0    0
7    1    4    0    0

which is precisely what my answer is computing.

Octave, 63 60 bytes

@(A)(@(L)sum(triu(A,1)')(L)+sum(tril(A))(L))(1:min(size(A)))

Try it online!

The answer for this matrix:

2   10   10    2    4
9    7    7    2    9
1    7    6    2    4
7    1    4    8    9

is the vector of row sums of its upper triangular part:

0   10   10    2    4
0    0    7    2    9
0    0    0    2    4
0    0    0    0    9

plus the vector of column sums of its lower triangular part:

2    0    0    0    0
9    7    0    0    0
1    7    6    0    0
7    1    4    8    0

which is precisely what my answer is computing.

2 added 2 characters in body
source | link

Octave, 63 bytes

@(A)(@(L)sum(triu(A)')(1:L)+sum(tril(A,-1))(1:L))(min(size(A)))

Try it online!

The answer for this matrix:

2   10   10    2    4
9    7    7    2    9
1    7    6    2    4
7    1    4    8    9

is the sumvector of rows inrow sums of its upper triangular part:

2   10   10    2    4
0    7    7    2    9
0    0    6    2    4
0    0    0    8    9

elementwise-plusplus the sumvector of columns incolumn sums of its lower triangular part:

0    0    0    0    0
9    0    0    0    0
1    7    0    0    0
7    1    4    0    0

which is precisely what my answer is computing.

Octave, 63 bytes

@(A)(@(L)sum(triu(A)')(1:L)+sum(tril(A,-1))(1:L))(min(size(A)))

Try it online!

The answer for this matrix:

2   10   10    2    4
9    7    7    2    9
1    7    6    2    4
7    1    4    8    9

is the sum of rows in its upper triangular part:

2   10   10    2    4
0    7    7    2    9
0    0    6    2    4
0    0    0    8    9

elementwise-plus the sum of columns in its lower triangular part:

0   0   0   0   0
9   0   0   0   0
1   7   0   0   0
7   1   4   0   0

which is precisely what my answer is computing.

Octave, 63 bytes

@(A)(@(L)sum(triu(A)')(1:L)+sum(tril(A,-1))(1:L))(min(size(A)))

Try it online!

The answer for this matrix:

2   10   10    2    4
9    7    7    2    9
1    7    6    2    4
7    1    4    8    9

is the vector of row sums of its upper triangular part:

2   10   10    2    4
0    7    7    2    9
0    0    6    2    4
0    0    0    8    9

plus the vector of column sums of its lower triangular part:

0    0    0    0    0
9    0    0    0    0
1    7    0    0    0
7    1    4    0    0

which is precisely what my answer is computing.

1
source | link

Octave, 63 bytes

@(A)(@(L)sum(triu(A)')(1:L)+sum(tril(A,-1))(1:L))(min(size(A)))

Try it online!

The answer for this matrix:

2   10   10    2    4
9    7    7    2    9
1    7    6    2    4
7    1    4    8    9

is the sum of rows in its upper triangular part:

2   10   10    2    4
0    7    7    2    9
0    0    6    2    4
0    0    0    8    9

elementwise-plus the sum of columns in its lower triangular part:

0   0   0   0   0
9   0   0   0   0
1   7   0   0   0
7   1   4   0   0

which is precisely what my answer is computing.