1.2 Simple Examples

Created Monday 30 December 2013

  1. Arithmetic operations:
    1. +
    2. -
    3. *****
    4. /
  2. Exponentiation:
    1. ^
  3. Natural logarithms/exponents:
    1. log
    2. exp
  4. Trigonometric functions:
    1. sin
    2. cos
    3. ...
  5. Real or imaginary numbers:
    1. i
    2. j
  6. Some math constants are predefined:
    1. e
    2. pi
  7. To verify type:
    1. exp(i*pi)
  8. Create a matrix and store it in a variable:
    1. A = [ 1, 1, 2; 3, 5, 8; 13, 21, 34 ]
  9. To display the value of a variable, type its name at the prompt:
    1. A
  10. Multiply the matrix 'A' by a scalar value:
    1. 2 * A
  11. Multiply 2 matrices 'A' and 'B':
    1. A * B
  12. Form the matrix product 'transpose (A) * A':
    1. A' * A



Backlinks: