Help with spectral analysis of a time series

I have a data set that contains surface elevation in meters and time in seconds.
I need to convert this data into an energy spectrum with Frequency on the X axis and Spectral Density (Amplitude Squared/Frequency) on the Y axis.
I believe I need to use Fourier Transform to achieve this but am currently unsure how to do this, any help would be greatly appreciated.

Asked:

on 13 Jan 2021

Answered:

on 1 Feb 2021

Community Treasure Hunt

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

Start Hunting!