matrix reader function
lendo mats do gabriel