implemented ex1 plotData.m