input dataset and save to .MAT

Not finished yet, but a start