Re: quad function
- From: Simon <simon8889@xxxxxxxxx>
- Date: Sat, 31 Dec 2005 04:25:35 -0500
John D'Errico wrote:
>
>
> In article <dp2tfu$lqa$1@xxxxxxxxxxxx>, Markus
<no@xxxxxxxxx>
> wrote:
>
>> Simon wrote:
>> > PB wrote:
>> >>
>> >> Simon wrote:
>> >>>
>> >>> Hi, I am a new user of MATLAB.
>> >>> I found out that some functions can't be
integrated using the
>> >>> quad/quadl syntax. Is it a limitation or else I
wrongly used
>> > it?
>> >>> I have to make use of Simpson's rule to solve
those
> functions.
>> >>>
>> >>> Thanks
>> >> Please post examples of the functions that you can´t
> integrate.
>> >>
>> >> /PB
>> >
>> > For example, f(x)=exp((-x^2./2)+tan(x)).
>>
>> It depends on your interval of integration because
>> tan(x) has singularities.
>
> Of course, Simpson's rule has the same issues with
> those singularities.
>
> Why do you say quad cannot integrate this function?
>
> f=@(x) exp((-x.^2/2)+tan(x));
> quad(f,0,1)
>
> ans =
> 1.6284
>
>
> Is it because you unnecessarily used ./ to divide by 2,
> but failed to use .^ to square x?
>
> HTH,
> John D'Errico
>
>
> --
> The best material model of a cat is another, or preferably the
> same, cat.
> A. Rosenblueth, Philosophy of Science, 1945
>
> Those who can't laugh at themselves leave the job to others.
> Anonymous
>
Thx a lot.
But I just found out that there are two methods for which I can
perform integration(quad and quadl). Which one is better?
For many functions, they just return the same answer.
.
- Follow-Ups:
- Re: quad function
- From: John D'Errico
- Re: quad function
- References:
- quad function
- From: Simon
- Re: quad function
- From: PB
- Re: quad function
- From: Simon
- Re: quad function
- From: Markus
- Re: quad function
- From: John D'Errico
- quad function
- Prev by Date: Re: Get keys outside of figure
- Next by Date: Frequency spectrum of a Digitally modulated signal
- Previous by thread: Re: quad function
- Next by thread: Re: quad function
- Index(es):
Relevant Pages
|
Loading