If I'm correctly understanding your question you would like to extract some digits from a number.
The mathematical approach is simply based on multiplication/division by powers of 10 and then using REM or MOD you can extract the number you are interested in.
>> A = 123.456;
>> rem(A,1)
ans =
0.4560
>> rem(A,10)
ans =
3.4560
You can then rescale this number appropriately to your needs.
Another way to work on the position is simply to convert the number into a string with NUM2STR and then index into the string to extract the desired value. String conversion has an additional computational cost but may be easier if you just need to operate on digits. With STR2DOUBLE you can convert the value back if you need to do additional arithmetic operations.
Best Answer