Lec 5
Lec 5
Electrical Engineering
Department
Chapter 5
Figure 5.7 (a) Complex numbers are plotted with the real component on the x-
axis and the imaginary component on the y-axis when a single array is used as
input. (b) When two complex arrays are used in the plot function, the imaginary
components are ignored.
ENGR 203_Dr. Mohsin Jamil, updated by Dr. 19
Amer
BASIC PLOTTING
B = sin(A)
returns
B = 0 3.1658 + 1.9596i 67.4789 -30.8794i 3.8537-27.0168i
and
plot(A, B)
title('Plot of Two Complex Arrays')
xlabel('Real Component of the X array')
ylabel('Real Component of the Y array')
Figure 5.8 (a) Adjusting the line, mark, and colour style. (b) Multiple plots with
various line styles and point styles.
Figure 5.9: Final version of the sample graph, annotated with a legend, a text
box, a title, x and y labels, and a modified axis.
Figure 5.14 Subplots are used to subdivide the figure window into an m×n matrix.
Figure 5.15 The subplot command allows the user to create multiple
graphs in the same figure window.
Mesh Plots
ØThere are several ways to use mesh plots. They can be used to good
effect with a single two-dimensional m×n matrix. In this application, the
value in the matrix represents the z- value in the plot. The x- and y-
values are based on the matrix dimensions. Take, for example, The code
z = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10;
2, 4, 6, 8, 10, 12, 14, 16, 18, 20;
3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
mesh(z)
xlabel('x-axis')
ylabel('y-axis')
zlabel('z-axis') generates the graph in Figure 5.28 .
3. Select Edit from the menu bar, then select copy figure and paste the
figure into another document.
4. You can use the file menu to create an M-file that will re-create the figure.
ENGR 203_Dr. Mohsin Jamil, updated by Dr. 59
Amer
END PROBLEMS CHPATER 5
ü5.1 to 5.16
ü5.21 to 5.24
ü5.28 to 5.30
ﮫﻠﻟا
ﻢﻛاﺰ
ﺟ اﺮﯿﺧ
.. ﺔﻠﺌﺳﻷا
. ENGR 203_Dr. Mohsin Jamil, updated by Dr.
Amer
61