3.1 Skalare Funktionen

Viele MATLAB-Funktionen sind skalare Funktionen und werden elementweise ausgeführt, wenn sie auf Matrizen angewandt werden. Die wichtigsten Funktionen dieser Art sind in Tab. 3.1 gegeben. Alle Funktionen dieser Art können mit dem Befehl help elfun aufgelistet werden. Der Befehl help specfun gibt eine Liste von speziellen mathematischen Funktionen wie Gamma-, Bessel-, Fehlerfunktion, aber auch ggT oder kgV aus.

Tabelle 3.1: Elementare Funktionen
Kategorie Funktion Beschreibung (gemäss MATLAB)
Trigonometrische sin Sine
  sinh Hyperbolic sine
  asin Inverse sine
  cos Cosine
  cosh Hyperbolic cosine
  acos Inverse cosine
  acosh Inverse hyperbolic cosine
  tan Tangent
  tanh Hyperbolic tangent
  atan Inverse tangent
  atanh Inverse hyperbolic tangent
  cot Cotangent
  coth Hyperbolic cotangent
  acot Inverse cotangent
  acoth Inverse hyperbolic cotangent
Exponentiell exp Exponential
  expm1 Compute exp(x)-1 accurately
  log Natural logarithm
  log1p Compute log(1+x) accurately
  log10 Common (base 10) logarithm
  log2 Base 2 logarithm and dissect
    floating point number
  sqrt Square root
  nthroot Real n-th root of real numbers
Komplex abs Absolute value
  angle Phase angle
  complex Construct complex data from real
    and imaginary parts
  conj Complex conjugate
  imag Complex imaginary part
  real Complex real part
Runden und Rest fix Round towards zero
  floor Round towards minus infinity
  ceil Round towards plus infinity
  round Round towards nearest integer
  mod Modulus (signed remainder after division)
  rem Remainder after division
  sign Signum


Diese Funktionen werden oft auf Vektoren angewandt, wie folgendes Beispiel zeigt.
     >> x=[0:pi/50:2*pi];
     >> y = cos(x.^2);
     >> plot(x,y)
     >> xlabel('x-axis')
     >> ylabel('y-axis')
     >> title('Plot of y = cos(x^2), 0 < x < 2\pi')
Diese Befehlssequenz generiert Abbildung 3.1
Abbildung: Plot der Funktion $ \cos(x^2)$
Image cosx2

Peter Arbenz 2008-09-24