2D Plots in MATLAB
2D Plots in MATLAB
INTRODUCTION TO MATLAB
ECE120L
Introduction
SYNTAX: figure
Plot
The command plot(x,y) calls the Figure Window and graphs the
function y against the independent variable x using a smooth line
connecting the data points x and y
SYNTAX: plot(x,y)
Stairs
The command stairs(x,y) calls the Figure Window and graphs the
function y against the independent variable x using discrete levels
based on the data points x and y.
SYNTAX: stairs(x,y)
Line Specifications
Add a title to the chart by using the title command. To display the
Greek symbol π, use the TeX markup, \pi.
Add axis labels to the chart by using the xlabel and ylabel functions.
SYNTAX: stem(x,y)
Plate 4a
Choose five functions to graph and use all the commands presented
in this lecture.