Added a function that creates a submatrix from a matrix without NA values