Documentation

output::roman

Roman numerals

Use only in the MuPAD Notebook Interface.

This functionality does not run in MATLAB.

Syntax

output::roman(n)

Description

output::roman converts an integer to the corresponding roman numeral. The return value is a string and can be used in messages.

Examples

Example 1

Convert some numbers to the corresponding roman numerals:

map([1, 2, 3, 4, 22, 134, 2001], output::roman)

Now, thanks to alias backsubstitution, we can trick MuPAD® into computing with roman numerals:

alias(`I`=1): // I is a reserved word in MuPAD, so we use `I` instead
for i from 2 to 1000 do
    eval(text2expr("alias(".output::roman(i)."=".expr2text(i).");"));
end_for:
II+II;
XIII*XXIV

unalias(`I`):
for i from 2 to 1000 do
    eval(text2expr("unalias(".output::roman(i).");"));
end_for:

Parameters

n

Positive integer

Return Values

String containing the roman numeral

See Also

MuPAD Functions

Was this topic helpful?