image thumbnail

ROMAN2NUM and NUM2ROMAN: modern Roman numerals

version 1.1.1 (35.8 KB) by François Beauducel
Converts Roman numerals to and from integers

2.6K Downloads

Updated 04 Jan 2021

From GitHub

View license on GitHub

These two scripts convert Roman numerals to and from any integer (scalar, vector or matrix), including large numbers greater than 4999 with the parenthesis notation (multiplies by 1000).

The function NUM2ROMAN uses strict rules of modern notation (substractive principle for 4 and 9 bases) except for the common 'MMMM' form replacing '(IV)'.

ROMAN2NUM is more flexible and is able to convert some other Roman notation possibilities, for instance the 3 different expressions roman2num({'IC','XCIX','XCVIIII'}) return [99,99,99], or roman2num({'MDXV','MCCCCCXV'}) return [1515,1515].

See help for syntax, and script comments for details.

Cite As

François Beauducel (2021). ROMAN2NUM and NUM2ROMAN: modern Roman numerals (https://github.com/beaudu/romanum/releases/tag/v1.1.1), GitHub. Retrieved .

MATLAB Release Compatibility
Created with R2020b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!
To view or report issues in this GitHub add-on, visit the GitHub Repository.
To view or report issues in this GitHub add-on, visit the GitHub Repository.