# besselk

Modified Bessel function of the second kind.

## Syntax

[k,ierr] = besselk(alpha, x, opt)

## Inputs

alpha
The function order.
Type: double
Dimension: scalar | vector | matrix
x
The function argument.
Type: double | complex
Dimension: scalar | vector | matrix
opt
The scaling option.
If set to 1 or true the result contains a factor of exp(x)).
Dimension: scalar | vector | matrix

## Outputs

k
The Bessel function values.
Dimension: scalar | vector | matrix
ierr
The return status flag.
Dimension: scalar | vector | matrix
info = 0
Successful return.
info = 1
Input error, returned NaN.
info = 2
Overflow condition, returned Inf.
info = 3
Calculation has lost at least half of machine accuracy.
info = 4
Calculation has lost significance, returned NaN.
info = 5
Algorithm failed to converge, returned NaN.

## Examples

Unscaled example:
k = besselk(3,[10:12;13:15])
k = [Matrix] 2 x 3
2.72527e-05  9.22218e-06  3.15163e-06
1.08563e-06  3.76397e-07  1.31209e-07
Scaled example:
k = besselk(3,[10:12;13:15],1)
k = [Matrix] 2 x 3
0.60028  0.55217  0.51294
0.48030  0.45266  0.42892

## Comments

If alpha and x have different dimensions, a singleton dimension in either variable is expanded to match the corresponding dimension length of the other variable.