Control Structures
Like most programming languages, Matlab has loops and conditional statements, although these are needed far less often because of the available array operations. The punctuation differs from Java.
if statement basic form:
if logical expression
statements
end
Example: if x > y
temp = x;
x = y;
y = temp;
end
Previous slide
Next slide
Back to first slide
View graphic version