* 为矩阵乘法
.* 为阵列乘法,逐个相乘
类似的还有 / \ ^ '
’ 为矩阵转置
.' 为数组转置
~= 为不等于
if ... end 语句
if ... else ... end 语句
if ... elseif ... else ... end 语句
switch 语句:
switch <switch_expression>
case <case_expression>
...
otherwise
end
当且仅当case为真(otherwise为真)时,执行case_expression
while <expression>
statement
end
for 循环:
1. for index = inival : endval
初值每次加一,直到大于终值
2. for index = inival : step : endval
规定步长
3. for a = array
disp(a)
迭代数组中的元素