Cody

# Problem 2283. Convert a number to its Roman representation

Solution 431622

Submitted on 14 Apr 2014 by James
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
%% x = 1; y_correct = 'I'; assert(isequal(your_fcn_name(x),y_correct))

d = Columns 1 through 8 1000 900 500 400 100 90 50 40 Columns 9 through 13 10 9 5 4 1 r = 'M' 'CM' 'D' 'CD' 'C' 'XC' 'L' 'XL' 'X' 'IX' 'V' 'IV' 'I' ans = []

2   Pass
%% x = 98; y_correct = 'XCVIII'; assert(isequal(your_fcn_name(x),y_correct))

d = Columns 1 through 8 1000 900 500 400 100 90 50 40 Columns 9 through 13 10 9 5 4 1 r = 'M' 'CM' 'D' 'CD' 'C' 'XC' 'L' 'XL' 'X' 'IX' 'V' 'IV' 'I' ans = []

3   Pass
%% x = 501; y_correct = 'DI'; assert(isequal(your_fcn_name(x),y_correct))

d = Columns 1 through 8 1000 900 500 400 100 90 50 40 Columns 9 through 13 10 9 5 4 1 r = 'M' 'CM' 'D' 'CD' 'C' 'XC' 'L' 'XL' 'X' 'IX' 'V' 'IV' 'I' ans = []

4   Pass
%% x = 867; y_correct = 'DCCCLXVII'; assert(isequal(your_fcn_name(x),y_correct))

d = Columns 1 through 8 1000 900 500 400 100 90 50 40 Columns 9 through 13 10 9 5 4 1 r = 'M' 'CM' 'D' 'CD' 'C' 'XC' 'L' 'XL' 'X' 'IX' 'V' 'IV' 'I' ans = []

### Community Treasure Hunt

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

Start Hunting!