基础运算
a = 1/2; //0.5
b = 1-2; //-1
c = 2*pi; //6.2832
d = 2^3;//8
常见数学函数
- exp: exponentiation (e^)
- abs: absolute value
- cos, sin, tan :cosine, sine and tangent
- acos,asin,atan :inverse of cosine, sine and tangent
- cosh,sinh,tanh: hyperbolic functions (also inverses)
- sqrt :square root
- conj :complex conjugate
- fix round :toward zero
- round :round toward nearest integer
- log :natural logarithm
- log10 :base 10 logarithm
- real :real part of complex number
- imag :imaginary part of complex number
矩阵表示
a=[1 2 3;4 5 6];
//1 2 3
//4 5 6
b