Plotting arrays of data are easy in MATLAB. Recall one can define 30 points between 0 and 2 by saying xlist=linspace(0, 2*pi, 30). To plot the sine function between 0 and 2 one says
To plot more functions, keep giving x, y pairs such as
plot(xlist, ylist, xlist, 2*ylist).
Note that we explicitly give MATLAB the x and y values for the plot.
At this point a new window appears on your screen containing the plot. This window will remain open during your session with MATLAB. The MATLAB clf command clears the graphics (figure) window.