% MVW, 2010-09-08 % Cut and paste this text into Matlab % % Example Matlab program to expand a binary integer, written % as a vector of 1s and 0s, into its decimal form. % function y = bin2dec(x) y=2.^((length(x)-1):-1:0) * x'; end