

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


ENGR 1731 C Computing for Engineers Practice Exercise for Final Exam Spring 2009
1.- Assume that A, B , and w are defined as follows, calculate the results of the following operations if they are legal, if an operation is not legal, explain why it is illegal.
A = [ 3 1 ; 2 0 ; 6 5 ]; B = [ 3 ; 2 ; 1 ]; w = 0.
g) B * A′ h) A* A′ i) A′ * A
2.- Assume that x and y , are defined as follows, calculate the results of the following operations if they are legal, if an operation is not legal, explain why it is illegal.
x = [ 3 6 ]; y = [ 3 ; 2 ; 2 ];
a) x * y b) y * x c) y * y
d) y * y′ e) y′ * y f) x′ * y′
g) y′ * x′ h) x′ * y i) y * x′
2.- Consider the following Matlab script, what is the result of running the code?
A = [ [1 2 3]' [3 2 1]' [2 1 3]'];
B = eye(size(A));
for j = 2:
for i = j: B(i,:) = A(j-1,:)*A(i,j-1); end
end
display(B)
3.- Two equal size spheres are placed in a rectangular prism, as shown in the figure below. Consider the
shown in the figure.
Write a MATLAB function that will determine the volume of the available “ free space” within the rectangular prism. Name your function FreeSpace. The input variables are r and h and the output variable is freevol.
The volume of a sphere is: (4/3) π r 3 and the volume of the rectangular prism is: h d 2
4.- Write a Matlab program that will solve the following problem: The admission fee at a small fair is $1.50 for children and $4.00 for adults. On a certain day, 2200 people enter the fair and $5050 is collected. How many children and how many adults attended? Notice that a system of equations will help to solve this problem.
5.- Assume you want to choose the best cell phone plan. Assume there are two phone companies that offer the following rates.
Write a Matlab Program that will answer the following questions a) At how many minutes do both companies charge the same amount? b) When is No-dead-zones a better Value? c) When is Signal-Always a better Value?
Notice that a system of equations will help to solve this problem.