Math 171 Spring 2005, Lab 5

Due Tuesday, February 8, 11:59 P.M.

  1. Overview
  2. Practicing Matlab Commands
  3. Assignment

Overview

Unlike Maple, Matlab's design focuses on providing a language for implementing numerical algorithms and working with matrices. While Maple provides a wider range of functionality, using Matlab in its area of specialization is generally more efficient and convenient. This lab will introduce you to working with matrices interactively; Matlab programming will be covered later.

Top

Practicing Matlab Commands

As with Maple, in order to run Matlab you may need to make some changes to your environment variables. Make sure your PATH variable contains the /usr/matlab/6.1/bin directory. Now either start a new shell or type


source ~/.zprofile

to update your shell environment without restarting. You should now be able to start Matlab by typing matlab at the command prompt.

The examples that follow will introduce you to all the Matlab commands you need to complete the assignment (with one exception that you must lookup yourself). Enter each of the following Matlab commands before continuing to the assignment section.

Top

Assignment

  1. Make sure you know which command to use for each of the tasks below. Then move into your lab directory and type
    
    clear
    diary off
    diary assignment
    
    
    and type the commands for each of the remaining tasks.
  2. Use exponential notation to express the inverse of the 10x10 upper diagonal matrix with 5's on the main diagonal and 3's above the main diagonal.
  3. Express the answer to the previous step using fractions.
  4. Find the determinant of the 25x25 tridiagonal (i.e. 3-banded) matrix with 1's above the main diagonal, 2's on the main diagonal, and 3's below the main diagonal.
  5. Use augmented matrices to enter and determine the fourth power of the matrix
        1    1    1    0    0    0    0    0    0
        1    1    1    0    0    0    0    0    0
        1    1    1    0    0    0    0    0    0
        0    0    0    2    2    2    0    0    0
        0    0    0    2    2    2    0    0    0
        0    0    0    2    2    2    0    0    0
        0    0    0    0    0    0    3    3    3
        0    0    0    0    0    0    3    3    3
        0    0    0    0    0    0    3    3    3
  6. Use matrix arithmetic to solve the simultaneous system of equations from lab 4:
    5x1+3x2+2x3=0
    8x1+4x2+2x3=-3
    3x1+5x2+7x3=6
  7. Solve the system of equations above using row reduction.
  8. Approximate the area of a semicircle of radius 2 using numerical integration.
  9. Find the antiderivative and derivative of y=2xe-x2.
  10. Approximate the first and second derivatives of the function y=x^3 numerically. Plot all the functions on the same graph.
  11. Determine the sum of all prime numbers less than or equal to 1000.
  12. When you have finished all of the tasks above, quit Matlab and submit your lab using the ~gbutler/bin/m171_submit command.

Top

Back to the course information page