% MVW, 2010-09-08
% Cut and paste this text into Matlab
%
% Example Matlab program to convert a decimal integer to binary.
%
function y = dec2bin(z)
y=rem(z,2);
while z>0
  z=floor(z/2);
  y=[rem(z,2) y];
end