MATLAB and Linear Algebra
SuperClassEE 348: Lab 2, Spring 2015 MATLAB and Linear Algebra 1 Introduction Lab 2 is a one-week lab. Your Lab 2 report may be uploaded to BbLearn or turned in as hard copy. This lab is due as follows: • If you are in the Wednesday lab: By the beginning of lab Wednesday, Jan. 28, 2015, for full credit. Late Lab 2: By the beginning of lab the following Wednesday, Feb. 4, for -20% late penalty. • If you are in the Friday lab: By the beginning of lab Friday, Jan. 30, 2015, for full credit. Late Lab 2: By the beginning of lab the following Friday, Feb. 6, for -20% late penalty. Labs are to be done individually, although you may consult together in groups in regards to the lab. It is expected that you will need to spend some time outside of lab to complete each lab and write up your lab report. 1.1 Lab Goals The primary goals of this lab are: • Use a stem plot to display a short discrete sequence. • Approximate a derivative by a finite difference algorithm. Use this algorithm to approximate the derivative of a function in MATLAB, and display the result, compared to the analytical result. • Understand how to use MATLAB to solve sets of linear equations. • Learn how to represent difference equations as a set of linear equations so as to solve for the output in MATLAB using matrix algebra. 2 Discrete Signals MATLAB represents signals in a discrete form. We can approximate a continuous signal x(t) in MATLAB by sampling at a high rate fs, which corresponds to sampling at a short time interval Ts = 1/fs. Our discrete signal x[n] = x(nTs); MATLAB uses floating point representation for variables, and thus is an ideal sampler. In Lab 1, we approximated a sinusoid s(t) in MATLAB by sampling at least 50 times each cycle. Our sampling time Ts is the step size t between elements of our time vector t; the step size t was chosen so that t had at least 100 elements and covered 2 cycles of the sinusoid s(t). Since s(t) had period T, t = T/50. When we plot the sampled sinusoid s[n] = s(nTs), it...
10 years ago
Purchase the answer to view it

- matlab_and_linear_algebra.docx