We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 5
ELEC 206 Matlab Practice Questions
Chapter | Questions
T ‘Sample problems 1-1, 1-2, 1-4
Problem 15 a,b
2 Sample problems 2-1, 2-2, 2-3,
Problems 1. 2. 3, 12.17
3 ‘Sample problems 3-1, 3-4
Problems 1, 3. 7a, 18
a Sample problem 4-3
Problem 6
3 Sample problem 5-1
7,9, 15
6 Sample problems 6-1, 6-2
Problem 15, 19
7 Sample problems 7-1, 7-2. 7-3
Problem 1,2
s ‘Sample problems 8-1, 8-2
Problem |
9 Sample problems 9-1, 9-2
Problems 1, 6
10 ‘Sample problem 10-21, TrueFalse (circle your choice):
2, T F The final step of the Engineering Problem-Solving Methodology is,
algorithm development.
b. TF The semicolon (;) suppresses output when used with MATLAB
commands.
c. TF The transpose operator (7) interchanges the rows and columns of a
matrix,
d. T F The disp command pauses a MATLAB program and prompts the user
for input.
2. Which MATLAB command generates a two-dimensional representation of a three-
dimensional surface?
a, mesh(z) c pie(x)
b. contour (2) d. figure (n)
3. Which MATLAB command generates 100 uniform random numbers
between -5 and
a. 10*rand (100) -5 c. 10*randn (100,1)-5
b, 10#rand(100,1)-5 — d,._— 5*randn (100) -10
4, Write the MATLAB commands to define the following matrices
135
“(2 4 6
b. F=[0.0 02 04 .. 996 998 100.0]
5. Show the results generated by the following MATLAB command.
y = (2.13.8; 8.5 5.1; 4.7 9.21;
maxy = max(y)6. Given the following table of line and color options, write the MATLAB command to
generate a plot for x vs y1 as a dotted green line and x vs y2.as a dashed red line
Line Type [ Indicator [Color | Indicator
dotted A green g
dashed red r
7. Which MATLAB command generates the solution to the system of equations AX=B?
a X= A/B c X= sum(A.*B)
bx
inv(A)*B dx
BAA’
8. Given the following matrices, show the results generated by these MATLAB
munand A.*I
eye (2)
(1 2; 2 3]
9. Given the following matrix, show the results generated by these MATLAB
commands.
v= [3.7 2.4 0.3 5.2 4.8]
ah = find(v>3.5)
b. high = v(n)
10, Given the following matrix, show the results generated by the MATLAB command.
R [1.22 3.78 2.41]
fprint£('R = ¢3.1£ \n', R)11, Write a MATLAB function that accepts time 2 as an input and returns a voltage
corresponding to the following equation: v~ e“sin(5?).
12. Write a MATLAB program to prompt the user for a time constant + and a max time
T, then generate a plot of v = e**.
13. Write the MATLAB commands to generate a table of conversions from inches to
centimeters. The range of inches should be from 0 to 36 in increments of 3.
14, Write a complete C++ program similar to that required by Exam 1