# Matlab tutorials for Math 365

Below are a series of tutorials that should help you become familar with Matlab syntax.

• Matlab as a graphing scientific calculator (Part I)
• Introduction
• Guide to lab exercises
• Getting help in Matlab
• Basic data types in Matlab
• Introduction to arithmetic operators
• Using parenthesis
• Formatting output
• Elementary functions and predefined constants
• Lab exercises
• Matlab as a graphing scientific calculator (Part II)
• Introduction
• Creating variables in Matlab
• Word of caution in choosing variable names
• Clearing and listing variables from memory
• Creating 'anonymous' functions in Matlab
• Lab exercises
• One dimensional arrays
• Introduction
• Using square brackets
• Using the colon operator
• Using the linspace command
• Column arrays
• Indexing arrays
• Special indexing rules
• Simple array concatenation
• Array functions for one-dimensional arrays
• Creating arrays of zeros, ones and random numbers.
• Elementary statistical functions
• Sorting values in an array
• Lab exercises
• The 'dot' operator : Arithmetic expressions involving arrays
• Introduction
• Arithmetic operations involving arrays
• The 'dot' operator : Element-wise operations
• Rules for using dot operators
• Lab exercises
• Matlab as a graphing scientific calculator (Part III)
• Introduction
• Using 'linspace' for plotting purposes
• Plotting curves
• Axis limits
• Adding symbols to the plot
• Adding a title and axis labels
• Printing the figure window
• Clearing and closing graphics windows
• The EZ way to plot
• Lab exercises
• The 'for-loop' and vectorizaton
• Introduction
• The 'for' loop
• The anatomy of the 'for' loop
• The 'for' loop - using the loop index variable
• Rules for using the 'for' loop
• When to vectorize?
• Lab exercises
• Two dimensional arrays
• Introduction
• From one-dimensional arrays to higher dimensional arrays
• Shapes of arrays
• Indexing two dimensional arrays
• Assigning values to arrays
• Array concatenation for two dimensional arrays.
• Lab exercises
• Introduction to matrices and matrix algebra
• Introduction
• Matrices
• Elementary matrix operations
• Some special matrices
• Creating sparse matrices
• Lab exercises
• Solving non-singular linear systems
• Introduction
• Backslash operator : x = A\b
• The LU Decomposition
• Using linsolve and mldivide
• Solving sparse linear systems
• Why don't we just use inv?
• Lab exercises
• Function approximation solving a Vandermonde system
• Introduction
• Function approximation using polynomials
• Approximating derivatives
• The Vandermonde system
• Lab exercises
• Lagrange polynomials
• Introduction
• Plotting the Lagrange polynomials
• Using Lagrange polynomials
• Lab exercises
• The Runge phenomenon
• Introduction
• Avoiding the Runge phenomenon (part I)
• Lab exercises
• Formatting output
• Introduction
• Using the 'format' statement
• Formatting - using 'fprintf' for scalar values
• Formatting - using 'fprintf' for arrays
• Lab exercises
• Using logical operators and conditional statements
• Logical operators
• Using logical operators with arrays
• Conditional statements
• Using arrays in conditional statements
• Using the Matlab 'find' function
• Lab exercises
• Logical operators and conditional statements
• Introduction
• Logical operators
• Using logical operators with arrays
• Conditional statements
• Using arrays in conditional statements
• Lab exercises
• Piecewise polynomial interpolation and the geometry of curves
• Introduction
• Single polynomial interpolant (polyfit)
• Piecewise Cubic Hermite Interpolating Polynomial (pchip)
• Cubic spline (spline)
• First derivative (polyfit)
• First derivative (pchip)
• First derivative (spline)
• Second derivative (polyfit)
• Second derivative (pchip)
• Second derivatives (spline)
• Computing tangents to the curve
• Lab exercises
• Root-finding and minimization
• Introduction
• The fzero function
• Function minimization
• Lab exercises
• Finite precision point arithmetic
• Introduction
• Examples : Floating point arithmetic
• More examples : Is floating point arithmetic commutative and associative?
• Examples (modified)
• Machine epsilon
• Lab exercises