How to convert '123' to [1,2,3]?

3 views (last 30 days)
Mr M.
Mr M. on 12 Dec 2017
Commented: per isakson on 13 Dec 2017
How to convert '123' to [1,2,3]? Which is the shortest way?

Accepted Answer

Image Analyst
Image Analyst on 12 Dec 2017
For single digits like you have, subtract '0':
s = '123'
numbers = s - '0'

More Answers (0)

Categories

Find more on Dates and Time in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!