a=123.456

a = num2str(123.456);
b = find(a=='.');
c = length(a)-b

或者一步到位:

a=123.456;

a=num2str(a);

weishu= length(a)-find(a=='.')