Finding an integer with matlab fft function

  • MATLAB
  • Thread starter ser23
  • Start date
  • #1
6
0

Main Question or Discussion Point

Hi, I hope someone could help me, I have been trying to solve this problem with FFT in matlab, why?, because my teacher gave it as homework. The problem is the following.

Obtain the value of the following integer using FFT:

the integer goes from [-infinte, infinite], and the function is x^2*exp(-x^2)*dx

He told us to check the definition of the fourier transform and I checked in books, matlab everywhere and I cant find any info that could help me, I hope someone here can, THANK YOU.
 

Answers and Replies

  • #2
chroot
Staff Emeritus
Science Advisor
Gold Member
10,226
34
I have no idea what you mean by "obtain the value of the following integer."

Can you please post the problem exactly as it was given to you?

- Warren
 
  • #3
6
0
I have no idea what you mean by "obtain the value of the following integer."

Can you please post the problem exactly as it was given to you?

- Warren
Sure, and thanks for your help

Solve the following integer using the FFT in MATLAB:

integer goes from[-infinite, infinite] and the function is:
x^2*exp(-x^2)dx

TIP: Check the fourier transform definition. (the tip is from my teacher).

By the way I tried to translate the problem the best I can, because even in spanish what my teacher writes is difficult to understand or to find the answer he is looking for by the problem he gave us.
 
  • #4
Dr Transport
Science Advisor
Gold Member
2,390
518
is he asking for the integral??????
 
  • #5
2
0
Yes, It should be intergral because of the dx at the end of the fuction.
 
  • #6
6
0
hi, yes the integral im sorry.
 
  • #7
836
13
He's asking how you would write a program to find the integral using the Fast Fourier Transform (FFT). I don't know how to do it, but I thought I should clear that up for other people.
 
  • #8
chroot
Staff Emeritus
Science Advisor
Gold Member
10,226
34
Seems like you should be able to evaluate this integral by using integration by parts. I don't understand what MATLAB has to do with it.

- Warren
 
  • #9
6
0
Actually this is the solution my teacher gave us. He said that this is a cool way to calculate an integral, I still don't get it, hope this info helps someone, and thank you all foru your help and good intentions.

>> N=1000;
x=linspace(-10,10,N);
dx=x(2)-x(1);
y=x.^2.*exp(-x.^2);
plot(x,y);
sum( y)*dx;
mm=(fft( y));
mm(1)*dx;
>>
 

Related Threads on Finding an integer with matlab fft function

Replies
1
Views
4K
Replies
4
Views
10K
Replies
11
Views
2K
  • Last Post
Replies
1
Views
5K
  • Last Post
Replies
12
Views
4K
  • Last Post
Replies
0
Views
2K
  • Last Post
Replies
10
Views
5K
  • Last Post
Replies
2
Views
4K
  • Last Post
Replies
2
Views
2K
Replies
0
Views
4K
Top