Академический Документы
Профессиональный Документы
Культура Документы
Session 2
Loops
while loops
Stopping criterion
When a pre-defined set of values has been
used. (for-loop)
According to a logical condition (while-loop).
Syntax:
while condition
commands
end
Operation:
If condition is true, commands are executed.
Test condition again. If true, commands are
executed. Repeat until condition is false.
If condition is false, continue execution after
end.
continue condition
True
False
commands
3
for - loops
Operation:
Location on disk.
Name a label used for reference
Contents the data stored in the file.
September 12
Syntax:
for var = row array
commands
end
Questions 2-3
contents
name
Session 2 page 1
File-types in MATLAB
File-types
Extension: the last token in a file-name.
Example: mydata.xls
Text files:
contain only letters (ascii characters).
Are readable by any text editor (e.g. NotePad)
Leaving a loop
Question 4
10
September 12
11
12
Session 2 page 2