Announcements

In this unit we will study the control structures ( ifs and loops ) available in MATLAB and their utilization in programs written as .m files.  In addition user defined functions will be discussed.

The operation of matrix multiplication and its use in solving linear systems of equations will also be covered in this unit.

The issue of linear systems of equations is studied rigorously during sophomore year in a Mathematics course. However we are all familiar with the simple 2x2 or 3x3 problems from High School algebra and precalculus. Don't panic!  Everything is quite simple!

For information about the company maintaining MATLAB look at :  http://www.mathworks.com/products/matlab/ .

 Reading Assignments

Book 2 : Pages 64 - 89

We suggest that you also use the help facility of MATLAB.

 Subtopics — Notes/ Examples:

 

A Hint Sheet for Matlab

 

 Tasks:

 

Task 1:  A composite machine element consists of an elastoplastic tube with a cylindrical core made of a different elastoplastic material. The force - elongation curve for the composite element is given by

Here a is related to the length of the element and it is about 1 mm.

Write a MATLAB program ( .m file) which calculates and displays the value of the force for a given value of delta and a. Linear interpolation must be used to calculate the force.

Task 2: Write a MATLAB program which reads an array of numbers and calculates how many of the numbers are negative and how many are in between 3.4 and 6.8.

Task 3: Do task 1 again, but this time use a MATLAB user defined function to calculate the force.  Include some lines of HELP for the function.

Task 4: Solve both by hand and by MATLAB the following system of equations:

-x1 + x2 –3 x4 = 4

x1 + 3 x3 + x4 = 0

x2 – x3 – x4  = 3

3 x1 + x3 + 2 x4 = 1

Jacob Y. Kazakia © 2001 All rights reserved