%converts binary number in (0,1) to a base-10 number

str = input('convert the binary number 0.','s') %enter binary number as string
x = str-'0'                                     %convert string to vector

num = 0;
for i=1:length(x)
    num = num + x(i)*2^(-i);
end

disp('the base-10 number is...')
num
    