
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!

BME 3400 – Biosystem analysis Spring 09
Page 1 of 1
Solve the following exercises using MATLAB and email the m-file to the lab instructor. You can work individually or in groups of 2 or 3 students. If you have questions, please email the instructor. The due date is February 13, 2009.
L = length(x); for j=1:L; if x(j)<0, x(j)=-x(j); end end
Rewrite this program without using a for loop.
x t
t
t
For t, use 1000 random numbers generated via the function rand(1,1000). Plot the signals t and x.
a) If the length of the original vector is L, what is the length of the new vector?
b) Extra credit: Instead of inserting zeros, insert numbers corresponding to the average of their neighbors. So, for the same original vector given above, the program should return: x3 = [0, 0.5, 1, 3, 5, 5, 5, 1.5, -2]