12.07.2015 Views

GNU Octave - Local Sector 7 web page

GNU Octave - Local Sector 7 web page

GNU Octave - Local Sector 7 web page

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 19: Arithmetic 16319 ArithmeticUnless otherwise noted, all of the functions described in this chapter will work for realand complex scalar or matrix arguments.19.1 Utility FunctionsThe following functions are available for working with complex numbers. Each expects asingle argument. They are called mapping functions because when given a matrix argument,they apply the given function to each element of the matrix.ceil (x)Mapping FunctionReturn the smallest integer not less than x. If x is complex, return ceil (real (x))+ ceil (imag (x)) * I.exp (x)Mapping FunctionCompute the exponential of x. To compute the matrix exponential, see Chapter 20[Linear Algebra], <strong>page</strong> 175.fix (x)Mapping FunctionTruncate x toward zero. If x is complex, return fix (real (x)) + fix (imag (x))* I.floor (x)Mapping FunctionReturn the largest integer not greater than x. If x is complex, return floor (real(x)) + floor (imag (x)) * I.g = gcd (a1, ...)Loadable Function[g, v1, ...] = gcd (a1, ...)Loadable FunctionIf a single argument is given then compute the greatest common divisor of the elementsof this argument. Otherwise if more than one argument is given all arguments mustbe the same size or scalar. In this case the greatest common divisor is calculated forelement individually. All elements must be integers. For example,gcd ([15, 20])⇒ 5andgcd ([15, 9], [20 18])⇒ 5 9Optional return arguments v1, etc, contain integer vectors such that,g = v 1 a 1 + v 2 a 2 + · · ·For backward compatiability with previous versions of this function, when all argumentsare scalr, a single return argument v1 containing all of the values of v1, ... isacceptable.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!