# besselh

Bessel functions of the first or second kind.

## Syntax

[h,ierr] = besselh(alpha, k, x, opt)

## Inputs

alpha
The function order.
Type: double
Dimension: scalar | vector | matrix
k
The function kind, either 1 or 2.
Dimension: scalar
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(-ix) when k = 1 or exp(ix) when k = 2.
Dimension: scalar | vector | matrix

## Outputs

h
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:
h = besselh(3,1,[10:12;13:15])
h = [Matrix] 2 x 3
0.05838 - 0.25136i   0.22735 - 0.09148i   0.19514 + 0.12901i
0.00332 + 0.22420i  -0.17681 + 0.12350i  -0.19402 - 0.07511i
Scaled example:
h = besselh(3,2,[10:12;13:15],1)
h = [Matrix] 2 x 3
0.08776 - 0.24267i  0.09249 - 0.22694i  0.09545 - 0.21357i
0.09721 - 0.20206i  0.09817 - 0.19204i  0.09855 - 0.18323i

## 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.