Practical 2: Variables, Script M-files and Graphing

Plotting Graphs

There are several ways to plot graphs in MATLAB. We will start by using the plot command to create a simple straight line graph by providing two sets of coordinates

\left(\left[x_{1} x_{2}\right],\left[y_{1} y_{2}\right]\right)

defining the start and end points, \left(x_{1}, y_{1}\right) and \left(x_{2}, y_{2}\right), respectively.