Harmonic Cursors

Display harmonic cursors in frequency or time series plots.
1.7K Downloads
Updated 3 Feb 2003

No License

Uses mouse-click input from user to set the value of the first harmonic, which diplays a line and lines for higher-order harmonics. Displays the value of the harmonics at the top of the axis, just above the axis box.

You can nudge the first harmonic in small increments by using the right mouse button; a right-click to the left of the first harmonic will nudge it left, and vice-versa for the right. (There is a "nudge_factor" that can be adjusted to make the nudge delta larger or smaller for your application.
If you want to remove the cursors, click once to get the crosshairs, and then click off of the axis to the left or right.

EXAMPLES: Can be used simply as a function call after a plot has been generated:
plot(x,y)
harmonic_cursors(gca)

Alternatively, the function can be called from the command line, from another function, or using a callback object by passing the axis handle of the plot as the argument.

A demo is included in the zip file.

Cite As

Jeffrey Daniels (2024). Harmonic Cursors (https://www.mathworks.com/matlabcentral/fileexchange/2982-harmonic-cursors), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R12
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Polar Plots in Help Center and MATLAB Answers

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes
1.0.0.0