University of Alaska Fairbanks
Geophysical Institute

Beyond the Mouse 2010 - The geoscientist's computational chest.

4. Fundamental Programming Principles II -- Control Flow

"Programming is legitimate and necessary academic endeavor."
Donald E. Knuth

How do we change the flow of a program based on certain conditions? Every (see: esolang) Usually a higher level programming language comes with constructs to evaluate conditions, repeat things until a certain condition is met, or repeat a statement list x times. This lecture contains basic logic [sic!], and definitions for flow control constructs in formal, Matlab, and C-Shell language.

Lecture

Fundamental Principles 2 (pdf)

LAB 04

Matlab Flow Control

Examples

This lecture contains many examples: tar.gz or zip archive. Work through them! Change things! Breaks things and try to fix them. Get your hands dirty! I mean it! ... !!!

Exercises:

4.0

Download examples and run the Matlab scripts -- play with them! Understand them!

4.1

Compute the results for the logic problems given on slide 9/19.

ronni <at> gi <dot> alaska <dot> edu | Last modified: February 01 2013 21:41.