MatLab Programming – Outline (a



MatLab = “Matrix Laboratory”

Plan of Study

The four sessions are designed to be work-at-your-own-pace tutorials and assumes no prior programming knowledge. The 1st lesson slowly introduces the student the MatLab environment. The 2nd & 3rd lessons provide demonstration scripts that the student must modify for practice. The 4th lesson provides mini-projects allowing the student to tie together the concepts they have learned.

Why MatLab?

o MatLab handles arrays (boxes of numbers) in a simple way.

o MatLab prepares you for more advanced languages like C++ and FORTRAN.

o MatLab has a well-designed user interface for easy and speedy programming.

o Engineers & scientists use MatLab for small, quick projects.

o MatLab has built in graphics unlike C++ and FORTRAN.

o MatLab tells you where the error is and is very quick to debug.

o Remember, human time is more valuable than computer time. Often an easier programming language is better than a more powerful language.

o Other tutorials at: & > Introduction

Learning Objectives

o Participants become proficient with quick use of MatLab visualization tools (2-D and 3-D) for future scientific work (& future science course homework).

o Participants develop better understanding of fundamental linear programming techniques for immediate use in MatLab and C++ programming. This includes among others

o array manipulation

o if-then logic

o while loops & for loops

o creating subroutines

o porting data

o Participants are immediately useful to faculty advisers in computational aspects of research.

Lesson Contents

Lesson 1

o Using MatLab as a calculator at the command line in the command window.

o Arithmetic.

o Variables.

o Symbolic and help menu.

o Linear algebra.

o Arrays.

o Simple 2-D plotting.

o Introduction to scripting with M-files.

o Intro to 3-D plotting: surf.

o User input.

o If-then logic.

o Numbered loops.

Lesson 2

o Review simple 2-D plotting, legends.

o More 3-D graphing: surfc, contour, plot3, colormaps.

o While loops.

o Outputting data to files.

o Inputting data to files.

o Inline Functions.

Lesson 3

o More 3-D graphing: isosurface.

o Multiple graphs: separate figures vs. subplots.

o Running M-file programs within other M-files.

o M-file functions.

Lesson 4

o Targeted practice with mini-projects.

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download