Filter löschen
Filter löschen

Using Bessel function of first kind

12 Ansichten (letzte 30 Tage)
Amir Cawich
Amir Cawich am 22 Nov. 2022
Beantwortet: Sakshay am 28 Nov. 2022
I am trying to use the bessel function in MATLAB as follows :
besselj(0,2.4048)= 1.3268e-5
however when i code it like this i get a different answer:
S= 2.4048;
besselj(0,S) = 0;
I am not sure what causes this difference. Can anyone explain why the answer changes? It happens for all values. and the differnce can be up to x10^6 sometimes
  2 Kommentare
Dyuman Joshi
Dyuman Joshi am 22 Nov. 2022
Bearbeitet: Dyuman Joshi am 22 Nov. 2022
Its working fine here.
val1=besselj(0,2.4048)
val1 = 1.3268e-05
s=2.4048;
val2=besselj(0,s)
val2 = 1.3268e-05
Can you show your code? Also, attach the results you are getting.
David Goodmanson
David Goodmanson am 23 Nov. 2022
Hi Amir, are you possibly getting the S value from some other place? If
S = 2.404825557695773
then in the usual format it is going to show up as
S = 2.4048
although it does not really have that value. Here
besselj(0,S)
ans = 0
and besselj(0,2.4048) gives the nonzero value you show.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Sakshay
Sakshay am 28 Nov. 2022
Hi Amir,
As per my understanding, you are facing an error while using the “besselj” function. The function doesn’t seem to have any problem like this. It should work the same for both the cases.
besselj(0, 2.4048)
ans = 1.3268e-05
s = 2.4048;
besselj(0, s)
ans = 1.3268e-05
Make sure that you are providing the correct input values to the function.
You can refer to the following documentation on "besselj" function for more information:

Kategorien

Mehr zu Bessel functions finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by