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?

Réponses (1)

Stephen23
Stephen23 le 31 Août 2015
Modifié(e) : Stephen23 le 10 Août 2016

2 votes

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'

Catégories

En savoir plus sur Characters and Strings dans Centre d'aide et File Exchange

Modifié(e) :

le 10 Août 2016

Community Treasure Hunt

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

Start Hunting!

Translated by