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?

Respuestas (1)

Stephen23
Stephen23 el 31 de Ag. de 2015
Editada: Stephen23 el 10 de Ag. de 2016

2 votos

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'

Categorías

Más información sobre Characters and Strings en Centro de ayuda y File Exchange.

Preguntada:

el 31 de Ag. de 2015

Editada:

el 10 de Ag. de 2016

Community Treasure Hunt

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

Start Hunting!

Translated by