[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Bessel function with octave(answer Bard Skaflstad)
From: |
john |
Subject: |
Bessel function with octave(answer Bard Skaflstad) |
Date: |
Thu, 18 Aug 2011 04:23:03 -0700 (PDT) |
Hi,
Thank you very much for your help.I tried this
function y=besintj0(x)
global x
y=1/pi*quad(@bintegra,0,pi); thats line 18 of besintj0
endfunction
function y=bintegra(q)
global x
y=(cos(x.*sin(q));thats line 4 of bintegra(here the error product
nonconformant.
endfunction
when I run this application I get the following error:
octave.exe:2> clear all
octave.exe:3> besseljm
Approximate the Bessel function via Taylor''s series
expansion, which fails for x far away from the point
of expansion around x=0. This program is accurate to
about 5 significant figures for 0<x<10.
Enter x: 3
Taylor''s series expansion gives: -0.26005
error: product: nonconformant arguments (op1 is 0x0, op2 is 1x13)
error: evaluating argument list element number 1
error: evaluating argument list element number 1
error: called from:
error: C:\Program Files\3.2.4_gcc-4.4.0\bin\mfiles\bintegra.m at line 4,
column 2
error: C:\Program
Files\3.2.4_gcc-4.4.0\share\octave\3.2.4\m\general\quadl.m at line 93,
column 5
error: C:\Program Files\3.2.4_gcc-4.4.0\bin\mfiles\besintj0.m at line 18,
column 3
error: evaluating argument list element number 1
error: evaluating argument list element number 1
error: evaluating argument list element number 1
error: evaluating argument list element number 1
error: C:\Program Files\3.2.4_gcc-4.4.0\bin\mfiles\besseljm.m at line 23,
column 4
octave.exe:3>
the error about the product is like multiplication of matrices.Is it right??
Next time I avoid the "global" statement but it is just for curiousity
Sincerely
Gilbert (John)
Belgium
address@hidden
--
View this message in context:
http://octave.1599824.n4.nabble.com/Bessel-function-with-octave-answer-Bard-Skaflstad-tp3752341p3752341.html
Sent from the Octave - General mailing list archive at Nabble.com.
- Bessel function with octave(answer Bard Skaflstad),
john <=