Cody

# Problem 1686. Generate a melodic contour string matrix

Solution 1598013

Submitted on 2 Aug 2018 by PE
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
str = '*rrr'; melody = '*-*-*-*'; assert(strcmp(parsons(str),melody))

m1 = 0 m2 = 0

2   Pass
str = '*du'; melody = ['* *' ' \ / ' ' * ']; assert(strcmp(parsons(str),melody))

m1 = 0 m2 = -1

3   Pass
str = '*ruuddduur'; melody = [' * ' ' / \ ' ' * * *-*' ' / \ / ' '*-* * * ' ' \ / ' ' * ']; assert(strcmp(parsons(str),melody))

m1 = 2 m2 = -1

4   Pass
str = '*rududdrudud'; melody = [' * * ' ' / \ / \ ' '*-* * * * * ' ' \ / \ / \ ' ' *-* * *']; assert(strcmp(parsons(str),melody))

m1 = 1 m2 = -1

5   Pass
str = '*rururddrdrdrd'; melody = [' *-* ' ' / \ ' ' *-* * ' ' / \ ' '*-* *-* ' ' \ ' ' *-* ' ' \ ' ' *-* ' ' \ ' ' *']; assert(strcmp(parsons(str),melody))

m1 = 2 m2 = -3

### Community Treasure Hunt

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

Start Hunting!