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 statements list x
times. This lecture contains
basic logic [sic!], and definitions for flow control constructs in formal, Matlab, and C-Shell
language.
Fundamental Principles 2 (pdf)
This lecture contains many examples: tar.gz or zip archive. Work through them! Change things! Breaks things and try to fix them. Get dirty, you geoscientists!
4.0 | Download examples and run the Matlab scripts -- play with them. |
4.1 | Using Matlab, write a function Solution: sum_of_even_squares.m |
4.2 | Write a Matlab script (or function) that implements this flow chart: fun_function. You will probably realize that this is an abstract version of the outer loop for our class. We'll fill in the details next week in class. So far, I only want you to take the step from something abstract that's written out on paper to executable code.
That's hard enough. There is no specific way I want you to do this. You may use whichever constructs from class seem suitable for the job. I do want this very flow chart
implemented, though (No changes in upper limits or initialization values, etc.; feel free to deliver prettier output, though).
On this note, be aware of Solution: fun_function.m |
ronni <at> gi <dot> alaska <dot> edu | last changed: Oct 01, 2009