Docsity

Old Examination 2 - Electrical and Computer Engineering Principles | ECE 2000, Exams of Electrical and Electronics Engineering

Toggle sidebar
bg1
ECE 2000 Exam #2 Name:__________________________
Fall 2003
Section ________ Grade:_________
Use the most concise Matlab statements to accomplish each task. Use the standard
numerical, NOT symbolic, methods (do NOT use SOLVE). Write very carefully, with clearly
identifiable spaces, commas, semicolons, parentheses, etc. Put all answers on YOUR paper.
Problem 1 [25 pts]. Write the shortest, most concise Matlab statements to accomplish
each of these tasks, given the following matrix definitions:
350
042
123
,
304
012 BA
(a) As part of an M-file, prompt the user to enter a numerical value, from the keyboard, for
the scalar variable “speed”, then accept and store that value.
(b) In the command window, show the string “The value of speed is “, followed by the
current numerical value of the variable “speed”, followed by the string “meters per
second”.
(c) Replace the 2nd row of matrix A with the values –4 5 1 from matrix B, using partitions
and concatenations involving A and B.
(d) Create a 4x4 identity matrix called “identity”.
(e) Create a sequence of approximately 100 values for x, covering the range from 1000 to
100,000 so that the values will be equally spaced on a plot that will use a logarithmic x-
axis.
Problem 2 [25 pts]. Write a Matlab program to plot these two functions of x on a single
graph figure (a “multi-plot”), with a single linear x-axis and linear y-axis. Use the good
plotting style that was stressed in class, including an appropriate legend. Use
approximately 200 points along the x-axis, with
64 x
.
x
x
xGxxxF
)sin(200
)(,524)(
3
Problem 3 [50 pts]. Write an M-file to enter these 4 matrices and then calculate the
results in the order shown below. Use the most concise Matlab statements to accomplish
each task.
1
2
,
4085
1269
,
9
4
3
7
,
7304
2618
3024
7123
dCbA
(a)
bAx
1
(b)
dC
bA
S
(c) Assign the determinant of A to the variable g.
(d) Create the matrix R as a partition of S, containing the intersection of rows 1, 2, 3, and 5
with columns 3 and 4 of S.
(e)
1
)(
ARCbU
T
(f)
bCdUV
T
)(

Partial preview of the text

Download Old Examination 2 - Electrical and Computer Engineering Principles | ECE 2000 and more Exams Electrical and Electronics Engineering in PDF only on Docsity!

ECE 2000 Exam #2 Name:__________________________

Fall 2003

Section ________ Grade:_________

Use the most concise Matlab statements to accomplish each task. Use the standard

numerical, NOT symbolic, methods (do NOT use SOLVE). Write very carefully, with clearly

identifiable spaces, commas, semicolons, parentheses, etc. Put all answers on YOUR paper.

Problem 1 [25 pts]. Write the shortest, most concise Matlab statements to accomplish

each of these tasks, given the following matrix definitions:

A B

(a) As part of an M-file, prompt the user to enter a numerical value, from the keyboard, for

the scalar variable “speed”, then accept and store that value.

(b) In the command window, show the string “The value of speed is “, followed by the

current numerical value of the variable “speed”, followed by the string “meters per

second”.

(c) Replace the 2

nd row of matrix A with the values –4 5 1 from matrix B, using partitions

and concatenations involving A and B.

(d) Create a 4x4 identity matrix called “identity”.

(e) Create a sequence of approximately 100 values for x, covering the range from 1000 to

100,000 so that the values will be equally spaced on a plot that will use a logarithmic x-

axis.

Problem 2 [25 pts]. Write a Matlab program to plot these two functions of x on a single

graph figure (a “multi-plot”), with a single linear x-axis and linear y-axis. Use the good

plotting style that was stressed in class, including an appropriate legend. Use

approximately 200 points along the x-axis, with  4  x  6.

x

x

F x x x G x

200 sin(  )

3

   

Problem 3 [50 pts]. Write an M-file to enter these 4 matrices and then calculate the

results in the order shown below. Use the most concise Matlab statements to accomplish

each task.

A b C d

(a) x A b

 1 

(b) 

C d

A b

S

(c) Assign the determinant of A to the variable g.

(d) Create the matrix R as a partition of S, containing the intersection of rows 1, 2, 3, and 5

with columns 3 and 4 of S.

(e)

1

U  b RC  A

T

(f) V U d Cb

T

(  )