Matlab Fourier amplitude(Y) vs. Frequency (X)

okd
okd used Ask the Experts™
on
I have columns of time history data as shown below. How to do the Fourier transform, and plot them as Fourier amplitude(Y) vs. Frequency (X)? Any example of MATLAB command or code will help. Thanks.

Time Value   Fourier Amplitude  Frequency
0         0.1
0.1      2
0.2      3
0.4      1
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
Is it an academic assignment? Cause we cannot do your home work on your behalf.
If you are studying Matlab, here is the links to documentation on Fourier transformation:
http://www.mathworks.com/access/helpdesk/help/techdoc/ref/fft.html
http://www.mathworks.com/access/helpdesk/help/techdoc/math/brentm1-1.html

Please look there and try to solve the task by yourself. Let us know if you will have problems.
okd

Author

Commented:
This is strictly not for academic assignment.
okd

Author

Commented:
However, you have answered my question. I normally use Maple, but thought of moving to Matlab. Therefore, I am very new to Matlab. Thank you.
Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

Commented:
Let me know if you need something else.
okd

Author

Commented:
When I use the command

data=dlmread('C:\My Documents\tsdata.txt','\t', 1,0);

it says,

??? error using dlmread
File not found or permission denied.

Thefeore, my question is how to select a path of the data file? - okd


Commented:
Are you sure you provided the correct path? The syntax is correct, but you probably don't have 'My Documents" folder in the root of C: drive. My Documents usually located at "C:\Documents and Settings\username\My Documents\". Or check if you have access to that folder.
You can just change your current directory to where tsdata.txt located, either with Matlab's GUI, or cd function.
cd C:\Documents and Settings\username\My Documents\
You can also specify the folder path separately as a variable, then use fullfile function to combine path and filename. For example:
dirname='C:\Documents and Settings\username\My Documents\';
dlmread(fullfile(dirname,'tsdata.txt'),...)

Also pls take into account this is different question than your original one.
okd

Author

Commented:
You are right. I am going to open another question for my quarries. Thank you.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial