puzzling questions on the quad function
- From: winewind <cy.yucao@xxxxxxxxx>
- Date: 30 Apr 2007 09:00:44 -0700
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!
.
- Prev by Date: Windows notepad & fprintf
- Next by Date: Re: a MATLAB GUI to move anywhere in a 3D scene
- Previous by thread: Windows notepad & fprintf
- Next by thread: Pixel values surrounding object of interest
- Index(es):
Relevant Pages
|