Record data into matrix
and plot the result
