650:231 Mechanical Engineering Computational Analysis and Design
Quiz 1
Instructions
This quiz is taken during class time. The time allowed is 20 minutes.
You may use your textbook, notes, homework solutions, and MATLAB Help.
DO NOT use internet except SA
PHYS 228 Pre-Recitation: 1
Use your own papers for writing the answers.
1. Answer the following question. Be clear and precise. No need to use ruler and compass
to draw pictures (DO NOT spend more than 5 minutes for drawing picture). Show your
work (write
Quiz 2
function primalitytest = primality(n)
n = input('Enter value of n: ');
m = 2; % initialise factor to test
t=floor(sqrt(n);count=0;
for m = 2:t
if mod(n,m) = 0 %m is a factor of n
disp('n is not prime')
primalitytest=0;
else
count=count+1;
end
end;
650:231 Mechanical Engineering Computational Analysis and Design
Quiz 4
Instructions
This quiz is taken during class time. The time allowed is 20 minutes.
You may use your textbook, notes, homework solutions, and MATLAB Help.
DO NOT use internet except SA
PHYS 228 Pre-Recitation: 2
Use your own papers for writing the answers.
1. A lens produces a real image of a real object.
A. Is the image inverted or upright? Explain.
B. Is the lens diverging or converging? Explain.
C. Is the image enlarged or reduced in
650:231 Mechanical Engineering Computational Analysis and Design
Quiz 5
Instructions
This quiz is taken during class time. The time allowed is 20 minutes.
You may use your textbook, notes, homework solutions, and MATLAB Help.
DO NOT use internet except SA
650:231 Mechanical Engineering Computational Analysis and Design
Quiz 2
Instructions
This quiz is taken during class time. The time allowed is 20 minutes.
You may use your textbook, notes, homework solutions, and MATLAB Help.
DO NOT use internet except SA
650:231 Mechanical Engineering Computational Analysis and Design
Quiz 6
Instructions
This quiz is taken during class time. The time allowed is 20 minutes.
You may use your textbook, notes, homework solutions, and MATLAB Help.
DO NOT use internet except SA
650:231 Mechanical Engineering Computational Analysis and Design
Quiz 3
Instructions
This quiz is taken during class time. The time allowed is 20 minutes.
You may use your textbook, notes, homework solutions, and MATLAB Help.
DO NOT use internet except SA
Quiz 6
clear all
%clr
A = [-1 2 1 -1; 0 -1 2 4; 0 0 2 1; 0 0 0 3];
u = [0 -1 2 2]';
[s,p]=size(A);
[q,r]=size(u);
if s~=p
dis('s is equal to p \n');
return
end
if q~=s, q~=p
dis('q is equal to s and p \n');
return
end
if r~=1
dis('r is not equal to 1 \n')
650:231 Mechanical Engineering Computational Analysis and Design
HW 3
1. Following the class notes, convert the following decimal integers to binary
by HAND CALCULATION: a) 23 b) 87 c) 378 d) 2388.
2. Use your code, confirm the results in problem 1.
3. Co