on-internet
← Community

Find and plot peaks/maxima

Stack Overflow ·

How can I plot the 'peak' (local maxima) in Matlab/Octave? My below code loads in an image, extracts the red channel and attempts to find and plot the local maxima but it fails with the error: error: findpeaks: DATA must be a vector of at least 3 elements Here is my simple code: pkg load image; pkg load signal; i = imread('foo.jpg'); % Get red channel red = i(:,:,1); % Attempt to find and plot peaks findpeaks(red); % Error on the above line: error: findpeaks: DATA must be a vector of at least 3 elements

Comments

Sign in or sign up to comment and upvote.

No comments yet.