MATLAB Flashcards

1
Q

if (expression)
statements
elseif (expression)
Statements
else if
Statements
end

A

“If” statement

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

repeatedly execute a block of code

For:
x = ones(1,10);
for n = 2:6
x(n) - 2*x(n-1);
end

While:
n =1;
nfactorial =1;
while nfactorial <1e100
n = n+1;
nfactorial = nfactorial*n;
end

A

MATLAB Loop structures

How well did you know this?
1
Not at all
2
3
4
5
Perfectly