-
标量运算
-
矩阵运算
-
数组运算
-
运算优先级
>> 5+6
ans =
11
>> 5-6
ans =
-1
>> 8*3
ans =
24
>> 8/2
ans =
4
>> 2\8
ans =
4
>> 2^2
ans =
4
>> power(2,2)
ans =
4
// power函数,可以代替^(平方符号)进行平方运算
>> 3*(((4+2)*5)-1)
ans =
87
//matlab程序中无大括号、中括号运算,都使用小括号,先内后外
//上面是几类标量运算的例子
·································································································
>> a=[1 2 3;4 5 6;7 8 9]
a =
1 2 3
4 5