How to declare a matrix with all elements set to zero in one statement?

matrix[M,N] bases_mat = rep_matrix(0, M, N)

Will do this for you

2 Likes