Convert Numbers to letters

Hi, excuse me, i hope you can help me with this, i want to convert numbers to letters in matlab, for example: insert number: 21 Answer: twenty one like that , i don't know how to do, what function i have to use?

回答 (1 件)

Stephen23
Stephen23 2015 年 8 月 31 日
編集済み: Stephen23 2016 年 8 月 10 日

2 投票

There is no inbuilt MATLAB function that converts numeric values to words, but you can use my FEX submission num2words to do exactly this:
It has been extensively tested, and has lots of useful options too.
Here are some examples:
num2words(0)
ans = 'zero'
num2words(-1024)
ans = 'negative one thousand and twenty-four'
num2words(pi, 'order',-10)
ans = 'three point one four one five nine two six five three six'
num2words(intmax('uint64'), 'sigfig',3, 'type','highest')
ans = 'eighteen point four quintillion'

カテゴリ

ヘルプ センター および File ExchangeDates and Time についてさらに検索

質問済み:

2015 年 8 月 31 日

編集済み:

2016 年 8 月 10 日

Community Treasure Hunt

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

Start Hunting!

Translated by