function b = str2bin(s)
%STR2BIN converts a binary string S to the equivalent decimal number
%
% Example of use
% b=str2bin('0101')
% This will return 0x2^-1 + 1x2^-2 + 0x2^-3 + 0x2^-1 
b=0;
L=length(s);
for i=1:L,
    k=str2num(s(i));
    b=b + k*2^(-i);
end
