Cody

Problem 1366. Finding peaks

Solution 219139

Submitted on 20 Mar 2013
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

This solution is outdated. To rescore this solution, sign in.

Test Suite

Test Status Code Input and Output
1   Fail
%% x= [2 12 4 6 9 4 3 1 19 7]; y_correct = [12 9 19]; assert(isequal(find_peak(x),y_correct))

Error: Undefined function 'findpeaks' for input arguments of type 'double'.

2   Fail
%% x=[ones(1,9) 10 zeros(1,10)]; y_correct = 10; assert(isequal(find_peak(x),y_correct))

Error: Undefined function 'findpeaks' for input arguments of type 'double'.

3   Fail
%% x=[1:10 100 -4 2 0 0 4 5 6 0] y_correct = [100 2 6]; assert(isequal(find_peak(x),y_correct))

Error: Undefined function 'findpeaks' for input arguments of type 'double'.

Suggested Problems

More from this Author9

Community Treasure Hunt

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

Start Hunting!