function imjpeg=jpeg(imw,quality);

% JPEG(inputfile,outputfile,quality);
%
%		Converts the image IMW
%		into the JPEG format
%
%		quality:    Image quality, 0..100  
%
%		e.g.: imjpeg=jpeg(imw,75);
%
%
% University of Rhode Island
% Dept. of Electrical Engineering
% Roger Meier, May '99


imwrite(imw,'temp.jpg','jpg','Quality',quality)
imjpeg=imread('temp.jpg');
delete('temp.jpg')