Matrix function generalization. Solve part of #110
Function to save csv tables with the data. Solve part of #110, close #109