questions on the integration with quad
- From: "Tommy Cao" <cy.yucao@xxxxxxxxx>
- Date: Mon, 30 Apr 2007 11:51:57 -0400
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: Re: Why does Matlab take 4 sec to rename a file?
- Next by Date: Two question on the integration with quad
- Previous by thread: Function '*' not defined for variables of class 'int16'.
- Next by thread: Two question on the integration with quad
- Index(es):
Relevant Pages
|