utils_mat function

Utilities for handling with matrices