MATLAB Answers

plotting frequency response of data in matlab

40 views (last 30 days)
shirin on 28 Oct 2020 at 17:22
Commented: Star Strider on 29 Oct 2020 at 0:48
Hi all,
I am trying to plot frequency response for the attached data. I can plot its time domain, However I am not able to plot the frequency response. Can anyone help please.


Sign in to comment.

Accepted Answer

Star Strider
Star Strider on 28 Oct 2020 at 17:34
There is only one column of data, that I assume are the independent variable. You cannot plot its frequency response without an associated time vector (vector of sampling instants). This is important with respect to knowing if the sampling intervals are constant (they can be resampled to constnt samplilng intervals if not), since that is required for all signal processing applications, including the Fourier transform. The time vector is required in order to calculate the frequency vector (independent variable) in the fft plot.


Show 3 older comments
Star Strider
Star Strider on 28 Oct 2020 at 22:08
I use the readmatrix function to read your file so that I can understand whatever the column headers are. Yours does not have any, so ‘Var1’ is the only column that exists. Use the file you posted and there should be no problem.
s = T1{:1};
with the file you posted will also work, and avoids the variable name incompatibility.
If you want to use a different file, attach it so that I can change my code to work with it.
shirin on 28 Oct 2020 at 22:50
Problem solved! Thanks a lot.
Many Thanks
Star Strider
Star Strider on 29 Oct 2020 at 0:48
My pleasure!
If my Answer helped you solve your problem, please Accept it!

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by