MATLAB: Select specific digits of a number

dataindexingMATLAB

How can I select specific parts of a number?
For example if we have x=953, I want to select specifically the first digit (or the last two) and save it in another variable, so the outcome would be y=9 (or y=53)
Thanks

Best Answer

x = 953
d = 100
r = mod(x, d) % 53
y = (x - r) / d % y = 9
Related Question