Write a script/function/program that converts a user inputted number or Roman numeral to its equivalent?

1) Write a script/function/program that converts a user inputted number or Roman numeral to its equivalent.
Recall Roman Numerals where:
I = 1
V = 5
X = 10
L = 50
C = 100
D = 500
M = 1000
Also remember IX is 9 (10 - 1) while XI = 11 (10+1) but XIX = 19 (10+9)
Most likely you will use the following function: str = input('Roman numeral: ','s')
Just to clarify -- your program should prompt a user to convert a Roman numeral into it’s numerical equivalent or take a number and output the equivalent Roman numeral.

类别

帮助中心File Exchange 中查找有关 Operators and Elementary Operations 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by