Tagged: Expression

elseif

elseif IF statement condition. elseif is used with IF. The statements after the elseif are executed if the expression is true and all the preceding IF and elseif expressions are false. An expression is...

if

if if statement condition. The general form of the if statement is if expression statements ELSEIF expression statements ELSE statements END The statements are executed if the real part of the expression has all...

for

for Repeat statements a specific number of times. The general form of a for statement is: for variable = expr, statement, …, statement END The columns of the expression are stored one at a...

end

end Terminate scope of FOR, WHILE, SWITCH, TRY, and IF statements. Without END’s, FOR, WHILE, SWITCH, TRY, and IF wait for further input. Each end is paired with the closest previous unpaired FOR, WHILE,...

else

else Used with IF. else is used with IF. The statements after the else are executed if all the preceding IF and ELSEIF expressions are false. The general form of the IF statement is...

Examples of Expressions

You have already seen several examples of MATLAB expressions. Here are a few more examples, and the resulting values. rho = (1+sqrt(5))/2 rho = 1.6180 a = abs(3+4i) a = 5 z = sqrt(besselk(4/3,rho-i))...