Finding each maximum and minimum value of a sinusoidal function

How do you find each of the maximum and minimum points of a sinusoidal function without using built into tool boxes and prefereable no loops.
Thank you,

Respuestas (1)

Star Strider
Star Strider el 9 de Feb. de 2019
That depends on the sinusiodal function and your constraints.
Use the max function to find the first maximum and its index, the min function to find the first minimum and its index. Those are going to be separated by π radians, so with a bit of calculation (and the associated time they occur) you then know the period and frequency, and can calculate the phase.
You should be able to take it from there to find the other maxima and minima.

Categorías

Preguntada:

el 9 de Feb. de 2019

Respondida:

el 9 de Feb. de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by