MATLAB: How to convert a number into a text string for their corresponding word in english

number conversion

I want to convert numbers into text strings for their corresponding words in english, for instance:
1—> 'one' ; 2 —> 'two' ; 52 —> 'fiftytwo' and so on
is there any functionality in matlab for this? Thanks in advance for any helpful answers : )

Best Answer

Very easily using my FEX submission num2words:
Easy to use, plus options for customizing the format, case, scale, sig-figs, etc:
>> num2words(0)
ans = 'zero'
>> num2words(1024)
ans = 'one thousand and twenty-four'
>> num2words(-1024)
ans = 'negative one thousand and twenty-four'
>> num2words(1024, 'pos',true, 'case','title', 'hyphen',false)
ans = 'Positive One Thousand and Twenty Four'
>> num2words(1024, struct('type','ordinal', 'case','sentence'))
ans = 'One thousand and twenty-fourth'
>> num2words(1024, 'and',false, 'order',1) % round to the tens.
ans = 'one thousand twenty'