Numeral Systems Toolbox 1.1

Convert from and to different numeral systems. Arabic, Roman, Mayan, Ionic, Babylonian.
2,9K Downloads
Aktualisiert 13. Okt 2003

Keine Lizenz

This toolbox contains four main functions that converts back and forth between different numeral systems. Numeral systems supported are yet so far only the ancient systems; Arabic, Roman, Mayan, Ionic and Babylonian.
The take a string or cellstring as an input which represents numerals in either Arabic or some other system and converts it to a string of numerals of the other system.

ROMAN : arabic <-> roman
MAYAN : arabic <-> mayan
IONIC : arabic <-> ionic (greek)
BABYLONIAN : arabic <-> babylonian

Thus you can convert between all of these systems. However some of them have certain interval constraints. Like the roman converter only allows for converting up to numbers as big as 3999 (arabic), whilst ionic numbers can only be as large as 999.

More systems will be added to the toolbox in the future.

Examples:

roman 1994 %will be 'MCMXCIV'
roman DCCCLXXXVIII %results in arabic '888'
roman(roman('2003')) %yields '2003'
str2num(roman('xxiii')) %the number 23
roman({'iv','VII','4'}) %results in {'4','7','IV'}

mayan 64302 %mayan: 8*20^3 + 0*20^2 + 15*20 + 2
mayan(char({'oo','='})) %mayan for arabic 7
mayan([mayan('45+') mayan('80+')]) %perform mayan addition

ionic 999 %results in '\sampi\qoppa\theta'
ionic \nu\zeta %same as arabic 57
title(ionic('456')) %displays the result

babylonian 21609 %147^2, notice the gap
babylonian('VVV <<VVVVVV') %same as 3*60+26 = 206
babylonian('YYY <<YYYYYY') %returns '206'
babylonian(roman('XLIV')) %returns babylonian for '44'

For more MATLAB programs, refer to http://www.etek.chalmers.se/~e8rasmus/eng/matlab_programs.html

Zitieren als

Rasmus Anthin (2024). Numeral Systems Toolbox 1.1 (https://www.mathworks.com/matlabcentral/fileexchange/4014-numeral-systems-toolbox-1-1), MATLAB Central File Exchange. Abgerufen .

Kompatibilität der MATLAB-Version
Erstellt mit R10
Kompatibel mit allen Versionen
Plattform-Kompatibilität
Windows macOS Linux
Kategorien
Mehr zu Operators and Elementary Operations finden Sie in Help Center und MATLAB Answers
Quellenangaben

Inspiriert von: chb

Community Treasure Hunt

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

Start Hunting!
Version Veröffentlicht Versionshinweise
1.0.0.0

Now includes the babylonian numeral system. Still, no converters support fractionals (yet to come).