% soundplay.m  reads file  *.dat  and plays the file 
function soundplay
  clear % use clear and pack on command line
  format compact
  filename=input('enter full file name of a audio file ?', 's');
  fid=fopen(filename, 'r');
  [y n]=fscanf(fid, '%f');
  fclose(fid);
  Fs=input('enter sample frequency in Hz ?');
  'number of samples '
  n
  'maximum value'
  max(y)
  'minimum value'
  min(y)
  'mean value'
  mean(y)
  sound(y,Fs)
end