14:440:127
Introduction to Computers for Engineers
Recitation 3 Problems for students to attempt
Please complete these problems on your own time if you do not finish in recitation. You don’t need to show us
the completed recitation problems, although we recommending saving a copy of your solutions for your own
benefit.
1)
Create a row vector containing the even numbers 2 through 18, a column vector containing 1,5,9,…,25,29, and a
3*3 matrix
A.
Then, transpose
A
and save that as
B
.
Finally, calculate the element by element (dot) multiplication
of
A
and
B
.
2)
Write a program that ask the user to input the value of ‘How many days do you want rent this DVD?’
Then,
calculate how much they should be charged for this rental.
The store charges $3.99 for the first day, and then $1 for
each additional day.
However, a week long rental is only $8.
After one week, they are charged $1 for each
additional day, up to a maximum fee of $50.
3)
Create a 3 x 4 matrix in which all the elements have a value of pi.
(consider creating a matrix in which all of the
values are 1 first, and then multiplying).
Then, change the 2nd row to pi.
Finally, compute the sine of each value
in the matrix.
4)
Find the zeros of the polynomial 5x
4
 4x
2
+ 18
5)
Use
help
to look up the
magic
function.
Create a 5 x 5 magic matrix.
Then:
a. sort each column of the matrix
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
This is the end of the preview.
Sign up
to
access the rest of the document.
 Fall '09
 blase
 $50, 4w, $8, $3.99, 4.5w

Click to edit the document details