Matlab Class Home
Class Outline
Previous Class
Next Class
Evaluation 6
Goal for week 6: Programming with loops and decisions
Summary of new tools and commands.
for
a loop construct to execute a block of commands for successive values of a variable
if
execute a block of commands if a logical expression is true.
elseif, else
execute blocks of commands based on alternative logical tests.
while
a loop construct to execute a block of commands while a test logical expression is true.
end
marks the end of the block of commands associated with
for
,
if
and
while
.
> >= < <= == ~=
logical comparison operators
logical operators:
&
for "and",
|
for "or" and
~
for "not".
fopen
opens a file for reading or writing.
fprintf
prints information to a file under format control.
fclose
closes access to a given file.
eval
executes a character string as a MATLAB command.
Tasks for Week 6
Tasks
1
Using loops to address individual values in vectors and arrays
2
Using logical tests to control calculations
3
Searching for values in arrays
4
Using indexing in arrays and writing to a file
5
Manipulating and using character variables
Matlab Class Home
Class Outline
Previous Class
Next Class
Evaluation 6
email: J. Klinck