MATLAB: How to get digits ( e.g.telephone number) from user and treat each digit separately

digitsdtmfinputMATLAB

Hello. My problem is I want to get digits (e.g.telephone number) from user, like 079389482, but the length of digits unknown. And I want to work on each digit separately, to build dtmf signal (plot) for each digit

Best Answer

If you get the digits as a string then this is easy by simply subtracting '0' from the string:
>> S = input('Please enter your telephone number: ','s');
Please enter your telephone number: 72643
>> V = S-'0'
V =
7 2 6 4 3