Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to set width in findmaxima #35

Closed
TorkelE opened this issue Jan 12, 2024 · 2 comments
Closed

How to set width in findmaxima #35

TorkelE opened this issue Jan 12, 2024 · 2 comments

Comments

@TorkelE
Copy link

TorkelE commented Jan 12, 2024

If I have a vector v, and want to find all peaks so that it is the highest value in the interval [i-w:i+w], how do I do it? The docs says

findmaxima(x[, w=1; strict=true]) -> (idxs, vals)

but I really do not understand what syntax to use, e.g.

findmaxima(x[, w=1; strict=true])

does not work. I can do

findmaxima(x)

but then I have w=1, which I not necessarily want.

@halleysfifthinc
Copy link
Owner

Hello! In Julia, docstring signatures wrap arguments in square brackets to denote that the arguments are optional (either positional or keyword; see the Julia docs here), but that is not a valid syntax to call the function . If you wish to call findmaxima with a different window size, you should use eg:

findmaxima(x, 5)
# or
findmaxima(x, 10; strict=false)

@TorkelE
Copy link
Author

TorkelE commented Jan 12, 2024

Got it, thanks :)

@TorkelE TorkelE closed this as completed Jan 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants