MATLAB: Binary to decimal conversion…….need ans immidiately plzzzzzzzzzzz

image processing

hello! I have a string of binary suppose a binary string of 2000 bit. A=[0 0 0 0 1 1 0 1 1 0 1 0 0 …………so on] I wana to convert it into decimals. though i use function B=bin2dec(A, 8). but it returns me error. i wana to convert each 8-bits into decimal number. plz help me how should i do it. Thanks

Best Answer

sum(bsxfun(@times,reshape(A,8,[]), 2.^(7:-1:0)'))