Two question on the integration with quad



Hi all,

I got two questions on the integration with quad function provided by

matlab.

1. Define a function of q first with
F=@(q) quad(@(x) besselj(1,x.*q), 0, 1e-7);

Then define the square of it with
F2=@(q)F(q).*F(q);

When I tried to integrate F2 over q
quad(F2,0,1e8);
error information shows: Error using ==> times
Matrix dimensions must agree.

I don't understand why this happens. How should I do such integration

since dblquad function can not be used here?

2. Regarding the first question, if I use
quad(@(q) F2,0,1e8);
matlab will give some funny result, though it is definitely not what I

want. It is like we are doing something just like
quad(@(x) @(x) x, 0,1)

How matlab treats @(x) @(x) here?

Thanks a lot!
.



Relevant Pages

  • Re: Wolfram Research QA process defect: Bug in Mathematica 6 - Integrate - 68 (Sqrt, invalid
    ... I do not knowck the capabilities of Matlab. ... definite integration doesn't work in general, ... and auto-code capabilities, ... similar may be handled by radically different code inside the CAS, e.g., ...
    (sci.math.symbolic)
  • Re: Problem with quad/quadl in matlab
    ... MATLAB is employing for various numerical operations. ... The user goes back and uses quad, ... might be as simple as Simpson's rule for integration. ... Do not use this device on someone elses fingers ...
    (comp.soft-sys.matlab)
  • Re: ode45 output
    ... the integration. ... I followed the steps (i.e. persistent variables, ... > Do you want your ODE function to accept additional input arguments ... > If you're using a version of MATLAB prior to 7.0, ...
    (comp.soft-sys.matlab)
  • Re: Matlab freezes when I try to integrate a function with symbolic variables
    ... then specific technical code question. ... Is this a processing problem with my CPU or is there ... anything I can do with MATLAB. ... complete the integration. ...
    (comp.soft-sys.matlab)
  • Re: Problem with quad/quadl in matlab
    ... I try to do this integration using matlab: ... When I do integration, quad/quadl can not ... The best material model of a cat is another, or preferably the same, cat. ...
    (comp.soft-sys.matlab)