# besselj

Bessel function of the first kind.

## Syntax

[j,ierr] = besselj(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(-abs(imag(x))).
Dimension: scalar | vector | matrix

## Outputs

j
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:
``j = besselj(3,[10:12;13:15]*i)``
``````j = [Matrix] 2 x 3
-1.07670e-13 - 1.75838e+03i  -2.91339e-13 - 4.75793e+03i  -7.85788e-13 - 1.28329e+04i
-2.11484e-12 - 3.45380e+04i  -5.68362e-12 - 9.28206e+04i  -1.52602e-11 - 2.49218e+05i``````
Scaled example:
``j = besselj(3,[10:12;13:15]*i,1)``
``````j = [Matrix] 2 x 3
-4.88820e-18 - 7.98304e-02i  -4.86586e-18 - 7.94655e-02i  -4.82805e-18 - 7.88480e-02i
-4.78024e-18 - 7.80672e-02i  -4.72610e-18 - 7.71830e-02i  -4.66814e-18 - 7.62365e-02i``````