MATLAB Answers

How do I extract the amplitude and the frequency from a sine function?

15 views (last 30 days)
MAC
MAC on 15 Apr 2021 at 2:43
Answered: Star Strider on 15 Apr 2021 at 11:36
I have this sine function:
10*sin(1000*t)
How do I extract the Amp=10 and the frequency=1000 as variables from that function?
Thanks.
  1 Comment
William Rose
William Rose on 15 Apr 2021 at 3:06
@MAC, your quesiton does not appear to be about Matlab as much as math. Unless you are talking about automated parsing of code, which I doubt. It is a math question. The site is not a homework-answering service. By the way, the frequency of that function is not 1000, if your units are cycles per unit time.

Sign in to comment.

Answers (1)

Star Strider
Star Strider on 15 Apr 2021 at 11:36
Use the fft function. Calculated, interpreted, and plotted correctly, it will give all that information.

Community Treasure Hunt

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

Start Hunting!