impute_matrix function

Impute missing values in given matrix