Cody

# Problem 44314. A Simple Tide Gauge with MATLAB

Solution 3060163

Submitted on 4 Oct 2020 by Matteo Lo Preti
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Pass
A = [5 8 10 12 8 13 14 10 10 15]; tide_correct = 1; assert(isequal(gauge(A),tide_correct))

differences = 3 2 2 -4 5 1 -4 0 5

2   Pass
A = [15 16 11 9 10 15 7 12 6 11 5 6]; tide_correct = 0; assert(isequal(gauge(A),tide_correct))

differences = 1 -5 -2 1 5 -8 5 -6 5 -6 1

3   Pass
A = [9 15 3 9 5 18 4 17 18 19 8 13 12 21 17 24]; tide_correct = 1; assert(isequal(gauge(A),tide_correct))

differences = 6 -12 6 -4 13 -14 13 1 1 -11 5 -1 9 -4 7

4   Pass
A = [22 12 22 12 9 14 17 16 15 8 13 6 10 7 13 3]; tide_correct = 0; assert(isequal(gauge(A),tide_correct))

differences = -10 10 -10 -3 5 3 -1 -1 -7 5 -7 4 -3 6 -10

### Community Treasure Hunt

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

Start Hunting!