MATLAB: To find the first 3 local maximas of a plot/ dataset without the islocalmax and findpeaks

findpeaksislocalmaxlocalmaxlocalmaximamax

Hi, everyone
Is it possible to find the first 3 local maximas of a plot/ dataset without the islocalmax and findpeaks syntax?
Thanks in advance, Grace

Best Answer

Yes.
Is this for homework or an exam?