Transfer a matrix to a list

mat2list(z_int, nvec)

Arguments

z_int

a vector with number of rows n.

nvec

an integer vector, specify the length of each component in the transferred list. n=sum(nvec).

Value

return a list with each componnet matrix.

Examples

mat2list(matrix(1, nrow=3+5, ncol=2), nvec=c(3,5))
#> [[1]]
#>      [,1] [,2]
#> [1,]    1    1
#> [2,]    1    1
#> [3,]    1    1
#> 
#> [[2]]
#>      [,1] [,2]
#> [1,]    1    1
#> [2,]    1    1
#> [3,]    1    1
#> [4,]    1    1
#> [5,]    1    1
#>