Name
sum_matrix_blocks — Returns a square matrix with the sum of the blocks of another square matrix.
Calling Sequence
sum_matrix_blocks(M,vect)
A = sum_matrix_blocks(M,vect)
Parameters
- M:
Square matrix to calculate the block's sum.
- vect:
Vector of the sizes of each squared block. Note that the sum of all entries of this vector must be equal to the size of the M matrix.
Examples
vect=[3 1]
M = [1 1 0 0;1 0 3 0;2 0 1 0;5 0 0 1]