function y=dec2byte(val,width)
% DEC2BYTE Convert decimal value to vector of byte-sized integers
%  DEC2BYTE(val,width) converts the number 'val' to a vector of byte-size integers
%  of size 'width'.

%  Created 1998 March 24
%  Ed.Doering@Rose-Hulman.Edu
%  Department of Electrical and Computer Engineering
%  Rose-Hulman Institute of Technology
%  Terre Haute, IN 47803-3999
%
%  Copyright (c) 1998 by Ed Doering.


y=hex2dec(reshape(dec2hex(val,2*width),2,width)')';