Numerical Analysis

Math 370 Fall 1998  MWF 11:30am - 12:25pm
\begin{matrix}c \\ ◯ \end{matrix}1998 Ron Buckmire  Fowler 127

Class 10: Friday September 25

SUMMARY Implementing Algorithms using Matlab CURRENT READING Recktenwald, Chapter 3

Programming in Matlab

Matlab has two different type of programs: scripts and functions. Scripts Scripts are just files which contain sequences of interactive Matlab commands. Scripts do not have input or output parameters. Variables used in scripts affect the variables in the Matlab variable space.

Functions Functions are Matlab subprograms similar to subroutines found in programming languages C or Fortran. Functions can use both global variables and local variables. Functions can have multiple inputs and outputs. Matlab Skills We want to be able to do a number of things using Matlab by the end of today’s class.

• Understand the key differences between functions and scripts

• Able to edit and run m-files (functions and scripts)

• Modify existing m-files to produce desired output

Plotting The main thing we want to be able to do after today’s class is be able to plot a given function in order to view its main features (especially the roots)