function whatsnew(arg)
%WHATSNEW Display Readme files for MATLAB and toolboxes.
%	WHATSNEW <toolboxpath> displays the Readme file for the toolbox
%	with the specified toolbox path.  For example,
%
%	whatsnew matlab    - Display MATLAB's Readme file.
%	whatsnew signal    - Display Signal Processing Toolbox Readme file.
%	whatsnew control   - Display Control Toolbox Readme file.
%
%	The Readme files, if they exist for each product, contain descriptions
%	of new functionality that is not described in the documentation.
%
%	See also VER, HELP, WHICH, PATH, LOOKFOR.

%	(c) Copyright 1984-93 by The MathWorks, Inc.

if nargin == 0 & isunix	% display some help
	disp(' ')
	disp('The following documents from the MATLAB 4.0 documentation set are')
	disp('available in compressed PostScript form in the event you don''t have')
	disp('your own printed copy. They provide information on what''s new in ')
	disp('this release of MATLAB and on converting from MATLAB 3.5 to MATLAB 4.0.')
        disp(' ')
        disp('The online versions of the New Features Guide and Release Notes')
        disp('may contain information not found in the hardcopy versions.')
        disp(' ')
	disp('   MATLAB 4.0 New Features Guide:')
	disp(['      ', getenv('MATLAB'),'/toolbox/matlab/newfeatures.ps.Z'])
	disp(' ')
	disp('   MATLAB 4.0a Release Notes:')
	disp(['      ', getenv('MATLAB'),'/toolbox/matlab/relnotes.ps.Z'])
	disp(' ')
	disp('   SIMULINK 1.2b Release Notes:')
	disp(['      ', getenv('MATLAB'),'/toolbox/simulink/relnotes1.2b.ps.Z'])
	disp(' ')
	disp('To print them, use a command of the form: zcat newfeatures.ps.Z | lpr')
	disp(' ')
	disp('To find out about undocumented features, use WHATSNEW with an argument:')
	help whatsnew
    	return
elseif nargin == 0
   help whatsnew
    	return
end
p = path;
pathsep = ':';
filesep = '/';
c = computer;
if strcmp(c(1:2),'PC')
	pathsep = ';';
	filesep = '\';
elseif strcmp(c(1:2),'MA')
	pathsep = ';';
	filesep = ':';
elseif strcmp(c(1:2),'VA')
	if strcmp(c(1:6),'VAXVMS')
		pathsep = ',';
		filesep = ']';
	end
end
if strcmp(arg,'matlab')
   arg = 'general';
end
seps = find(p == pathsep);
first = [1 seps+1];
last = [seps-1 length(p)];
larg = length(arg);
wd = cd;
for i = 1:length(first)
   pp = p(first(i):last(i));
   lp = length(pp);
   if lp >= larg
      if strcmp(arg,pp(lp-larg+1:lp))
         cd(pp);
         if exist([pp filesep 'Readme.m'])==2
            help Readme
         end
      end
   end
end
cd(wd);
