# besselk

## Purpose

Modified Bessel functions of the second kind.

## Synopsis

````K = besselk(alpha,x)`
`K = besselk(alpha,x,1)`
```

## Description

`K = besselk(alpha,x)` computes modified Bessel functions of the second kind for real, non-negative order `alpha` and argument `x`. If `alpha` is a scalar and `x` is a vector, `K` is a vector the same length as `x`. If `x` is a vector of length `m` and `alpha` is a vector of length `n`, then `K` is an `m`-by-`n` matrix and `K(i,k)` is `besselk(alpha(k), x(i))`. The elements of `x` can be any nonnegative real values, in any order. For `alpha`, the increment between elements must be 1, and all elements must be between 0 and 1000, inclusive.

The relationship between `K` and the ordinary Bessel functions `J` and `Y` is

`K = besselk(alpha,x,1)` computes `besselk(alpha,x).*exp(-x)`.

## Algorithm

The `besselk` algorithm is based on a FORTRAN program by W.J. Cody and L. Stoltz, Applied Mathematics Division, Argonnne National Laboratory, dated May 30, 1989.

````bessel`, `besseli`, `besselj`, `bessely`