Cody

# Problem 229. Fizz Buzz

Solution 127692

Submitted on 15 Aug 2012
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   Fail
%% x = 1; y_correct = {'1'}; assert(isequal(fizzbuzz(x),y_correct))

Error: Assertion failed.

2   Pass
%% x = 3; y_correct = {'fizz'}; assert(isequal(fizzbuzz(x),y_correct))

3   Pass
%% x = 5; y_correct = {'buzz'}; assert(isequal(fizzbuzz(x),y_correct))

4   Pass
%% x = 15; y_correct = {'fizzbuzz'}; assert(isequal(fizzbuzz(x),y_correct))

5   Fail
%% x = [1 3 5 15 16]; y_correct = {'1', 'fizz', 'buzz', 'fizzbuzz','16'}; assert(isequal(fizzbuzz(x),y_correct))

Error: Assertion failed.

6   Pass
%% x = []; y_correct = {}; assert(isequal(fizzbuzz(x),y_correct))

7   Fail
%% x = 1:100; y_correct = arrayfun(@(n)num2str(n), x, 'uniform', false); y_correct(mod(x, 3)==0) = {'fizz'}; y_correct(mod(x, 5)==0) = {'buzz'} y_correct(mod(x, 15)==0) = {'fizzbuzz'}; assert(isequal(fizzbuzz(x),y_correct))

Error: Assertion failed.