ELEC 241 Lab

Plotting X vs Y

One way to plot one variable vs another is with the Plot() function of Matlab.


Step 1:

Start matlab by double clicking on the matlab icon on the desktop.

Step 2:

Enter the x and y values as vectors.

>> x=[1 2 3 4 5 6];
>> y=[10 20 40 80 120 160];

Step 3:

Type "plot(x,y)".

Step 4:

To print a copy of the plot select "Print" from the "File" menu in the figure window.