Computer Methods in Biomedical Engineering - Practice Exam II | BME 201, Exams of Biology

Material Type: Exam; Professor: Sawicki; Class: Computer Methods in Biomedical Engineering; Subject: Biomedical Engineering; University: North Carolina State University; Term: Spring 2011;

Typology: Exams

2010/2011

Uploaded on 03/31/2011

goalie4eva
goalie4eva 🇺🇸

31 documents

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
PRACTICE EXAM II - BME 201 - SPRING 2011
Note: Please bring a calculator to the exam. You may need it and I will not have
extras.
Question 1 (30 pts):
A rectangular box with a square base (b ft. x b ft.) and a height, h ft. has an open top and
is to be made from 60 ft2 of material.
(a) Write an anonymous function called SA, that will output the box surface area that has
a two input variables (b, for box base length and h, for box height). (10 pts)
(b) Define a second anonymous function called reciprocalV (10 pts) and then use
fminbnd (10pts) to solve for the dimensions bopt and hopt of the box that has the largest
possible volume? (Hint: 1/a large number = a small number)
Question 2 (30 pts):
a. Create a user-defined function called factorial.m to find the factorial, N! (e.g. 4! =
4*3*2*1 = 24). Your function should confirm that the user input is a positive scalar value.
Do not use the built-in Matlab function for factorial. Demonstrate the proper use of
function and programming syntax. (15 points)
b. Trace through your function step-by-step to verify that 4! =24. (10 points)
Question 3 (40 pts):
A student has written the following function intended to process an input velocity array, V
(mm/s) and return an output normalized force array, normForce (unitless) using the
piecewise Hill Equation (assume numbers and parentheses in the equations are
correct). The program does not produce the expected results when experimental velocity
data is passed in.
function normForce = myHillEquation(V, Vmax, k )
stepsize = 2;
i=1;
for V= Vmax : stepsize : Vmax
if V <= 0
normForce (i) = (1+ V/Vmax) / (1V/k/Vmax);
else
normForce (i) = 1.8 .8*(1V/Vmax) / (1+7.56*V/k/Vmax);
end
i=i+1;
end
a. What should the value of the normForce array be for the inputs V= [-50 0 25],
Vmax=50 and k=1? (10 points)
pf3

Partial preview of the text

Download Computer Methods in Biomedical Engineering - Practice Exam II | BME 201 and more Exams Biology in PDF only on Docsity!

PRACTICE EXAM II - BME 201 - SPRING 2011

Note: Please bring a calculator to the exam. You may need it and I will not have extras.

Question 1 (30 pts):

A rectangular box with a square base (b ft. x b ft.) and a height, h ft. has an open top and is to be made from 60 ft^2 of material.

(a) Write an anonymous function called SA, that will output the box surface area that has a two input variables (b, for box base length and h, for box height). (10 pts)

(b) Define a second anonymous function called reciprocalV (10 pts) and then use fminbnd (10pts) to solve for the dimensions b (^) opt and h (^) opt of the box that has the largest possible volume? (Hint: 1/a large number = a small number)

Question 2 (30 pts):

a. Create a user-defined function called factorial.m to find the factorial, N! (e.g. 4! = 432*1 = 24). Your function should confirm that the user input is a positive scalar value. Do not use the built-in Matlab function for factorial. Demonstrate the proper use of function and programming syntax. (15 points)

b. Trace through your function step-by-step to verify that 4! =24. (10 points)

Question 3 (40 pts):

A student has written the following function intended to process an input velocity array, V (mm/s) and return an output normalized force array, normForce (unitless) using the piecewise Hill Equation (assume numbers and parentheses in the equations are correct). The program does not produce the expected results when experimental velocity data is passed in.

function normForce = myHillEquation(V, Vmax, k )

stepsize = 2; i=1;

for V= −Vmax : stepsize : Vmax

if V <= 0 normForce (i) = (1+ V/Vmax) / (1−V/k/Vmax); else normForce (i) = 1.8 − .8(1−V/Vmax) / (1+7.56V/k/Vmax); end

i=i+1; end

a. What should the value of the normForce array be for the inputs V= [-50 0 25], Vmax=50 and k=1? (10 points)

b. By hand-tracking the above code, determine what the above function will output for the inputs V= [-50 0 25], Vmax=50 and k=1 (15 points)

c. Revise the above function so that it produces the expected/correct output (15 points)

BONUS (20 pts):

(a) How would you use high and low pass filters to limit the range of a signal to 20- 460Hz (hint: think back to the EMG signal processing labs)? What would the cutoff frequencies of your filter(s) be? (10 points)

(b) The figures below show the original signal (top) and its power spectrum (bottom). Label the x-axis of both plots with the appropriate label. Also, interpret the plots (i.e., what does the power spectrum plot tell you about the original signal?) (10 points)

You are the lucky winner of an all

*OTHER PRACTICE QUESTIONS:

Example 1.

updown = [2, 4, 6, 8, 7, 5, 4]; time = [1, 2, 3, 4, 5, 6, 7];

Write a Matlab function that takes two input arrays (time and updown) and returns endtime, the time when the value of the array updown first stops increasing.

Example 2.

You have won an all expenses paid trip to Las Vegas and are given $2500.00 to gamble with!! You track your outcome for each gaming episode (hand, spin, hour, day, whatever...) into an array named episodeWinnings. Assume episodeWinnings exists and is an array of positive (win) and negative (loss) numbers.