input_to_matrix function

Converts inputs to matrix