Vous êtes sur la page 1sur 5

MATLAB

lecture 5
Olawale B. Akinwale
Dept of Electronic & Electrical
Engineering
Obafemi Awolowo University, Ile-Ife
Plotting Graphs
• plot(x,y)
– x = [1 2 3 4 2 5 2] y = [5 4 3 4 1 4 2]

• plot(y)
– x = [34 2 4 1 4 9]
– y = [1+2i, 2 +3i, 2 -3i]

• plot(x,y,s)
Plotting Graphs (cont’d)

• plot(x,y)
– where
x = -180:1:180 y = sin(x)

• Hold
– y = cos (x)
Plotting Graphs (cont’d)

• Plot the above data with the points shown as


circles.

• Plot the above data with the points joined by


lines.

• Plot the points as green stars.


Plotting Graphs (cont’d)

• Plot x against log(x) where x = 1:0.1:100;

• Type semilogx(x,log(x)) and put a grid on the


plot.

Vous aimerez peut-être aussi