I am unable to understand the use of ~ here.I know that find peaks returns two arguments x and y axis of peak

2 views (last 30 days)

Answers (1)

Stephen23
Stephen23 on 12 Jun 2021
Edited: Stephen23 on 12 Jun 2021
In both of the examples you show, the code's author wanted the second output from FINDPEAKS, and so ignored the first output using the tilde. What outputs a function has is explained by its documentation.
"I know that find peaks returns two arguments x and y axis of peak"
The findpeaks documentation actually says that its first two outputs are:
  1. "pks ... a vector with the local maxima (peaks) of the input signal vector, data."
  2. "locs ... the indices at which the peaks occur."

Products


Release

R2019a

Community Treasure Hunt

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

Start Hunting!