MATLAB: Finding Maximum Values And Putting Auto Cursor

data cursormaximum

Hello,
I have X and Y data and plotted a figure with these data(with plot(X,Y) code). These X and Y points will be changed with obtaining new experimental results. I want to find the first 3 maximum points of Y and to put auto data cursor on these maximum points.
How can i solve these problems?
Thanks in advance

Best Answer

Read about findpeaks. This exactly does what you want.