MATLAB is widely used for numerical calculations (a special toolbox

allows one to also perform symbolic manipulations using the MAPLE

kernel) in the industry, and in classes like differential equations,
linear

algebra, and many engineering classes, in particular at the junior
and

higher levels.

In our class we will begin slowly, primarily for calculations where
in the

past we used EXCEL. -- Often you may like to still use EXCEL for

planning, laying out your data tables or matrices -- and then do the

real calculations in MATLAB.

1. Saying hello to MATLAB:

Take a guided tour, play w/ demo, explore the interface and help features.

2. Plotting in MATLAB:

MATLAB is as honest as possible: It will only plot points, and connect

them if you tell it to do so.

Exercise: Overlay the plot of y=sin(x) (using a red line) and the plot
of

y=1/(1+x^2) using blue circles (for the points) for x from -7 to 7
in

steps of Dx=0.2.

3. MATLAB knows essentially only one data structure: matrices -- but
it

is quite amazing what matrices may represent. Tables, pictures, polynomials,

vectors, systems of equations, and so on!

Matrices and linear maps are studied in great detail in linear algebra
(MAT

242 and MAT 342). There are no major surprises on how to add and subtract

matrices, or multiply them by scalars.

However, the way matrices are "most naturally multiplied" comes as
a surprise

for most novices.

Work through the assignments in the sheet multiplying
matrices. You may

want to refer to these
data. As ** homework** (for substantial bonus credit, due

date Friday 2/19) create some larger example with more realistic foods, and,

e.g. your team's real food choices. Use MATLAB to multiply the matrices,

and paste the results into WORD (or your favorite word processor).

Create matrices A, B, C of sizes 2 x 3, 2 x 3 and 3 x 2, respectively.

Try out A*B, A.*B, B.*A, A*C, C*A, A.*C -- can you see what is going
on?

If not start with "simpler" matrices A,B,C (e.g. more A=[10,1,0;300,0,7000],

so that it easier to track where the numbers come from).

4. The most common use of matrices, and also the usual starting place
for any

linear algebra class are systems of linear equations.

Example: Find a quadratic function y=x_{1}+x_{2}t+x_{3}t^{2}
whose graph passes through

the points (..,..), (..,..), (..,..).What are the unknowns? Find a
system of three

linear equations that represent the information given by the data points.
Use

MATLAB to solve this system.

Exercise: Let y_{1}y_{2}y_{3}y_{4}y_{5}y_{6}y_{7}y_{8
}denote
the digits of your birthrate in the form

mmddyyyy. Find a function y=x_{1}+x_{2}t+x_{3}t^{2}+x_{4}t^{3}+x_{5}t^{4}+x_{6}t^{5}+x_{7}t^{6}+x_{8}t^{7}
that

"interpolates" (whose graph passes through) the points (1,y_{1}),(2,y_{2}),(3,y_{3}),

(4,y_{4}),(5,y_{5}),(6,y_{6}),(7,y_{7}),
and (8,y_{8}).

Use an 8 x 8 matrix in MATLAB. Plot the points (e.g. red circles) and
overlay

the graph of the interpolating polynomial (e.g. blue line).

Complete all unfinished work as ** homework** (for substantial
bonus credit,

due date Friday 2/19.)