Numeral Systems Toolbox 1.1

バージョン 1.0.0.0 (12.7 KB) 作成者: Rasmus Anthin
Convert from and to different numeral systems. Arabic, Roman, Mayan, Ionic, Babylonian.
ダウンロード: 2.9K
更新 2003/10/13

ライセンスがありません

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

引用

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

MATLAB リリースの互換性
作成: R10
すべてのリリースと互換性あり
プラットフォームの互換性
Windows macOS Linux
カテゴリ
Help Center および MATLAB AnswersOperators and Elementary Operations についてさらに検索
謝辞

ヒントを得たファイル: chb

Community Treasure Hunt

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

Start Hunting!
バージョン 公開済み リリース ノート
1.0.0.0

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