Home > atmlab > atmlab > atmlab_version.m

atmlab_version

PURPOSE ^

ATMLAB_VERSION Atmlab version number.

SYNOPSIS ^

function varargout = atmlab_version

DESCRIPTION ^

 ATMLAB_VERSION   Atmlab version number. 

    Version number taken from the ChangeLog file.

    If there is no output argument, a message is printed to the screen.

    If there is a single output argument, a string is returned.

    If there are three outputs, [major, minor, micro] are returned.

 FORMAT   s = atmlab_version
        
 OUT (1 output argument mode)

   s   Version string

 OUT (3 output arguments mode)

   major, minor, micro   Version numbers

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

atmlab_version.m

SOURCE CODE ^

0001 % ATMLAB_VERSION   Atmlab version number.
0002 %
0003 %    Version number taken from the ChangeLog file.
0004 %
0005 %    If there is no output argument, a message is printed to the screen.
0006 %
0007 %    If there is a single output argument, a string is returned.
0008 %
0009 %    If there are three outputs, [major, minor, micro] are returned.
0010 %
0011 % FORMAT   s = atmlab_version
0012 %
0013 % OUT (1 output argument mode)
0014 %
0015 %   s   Version string
0016 %
0017 % OUT (3 output arguments mode)
0018 %
0019 %   major, minor, micro   Version numbers
0020 
0021 % 2002-12-09   Created by Patrick Eriksson.
0022 
0023 function varargout = atmlab_version
0024 
0025 % Version information now taken from ChangeLog
0026 
0027 toppath = fileparts( fileparts( which( 'atmlab_version' ) ) );
0028 
0029 changelog = fullfile( toppath, 'ChangeLog' );
0030 
0031 fid = fopen( changelog, 'r' );
0032 
0033 if fid < 0
0034   s = 'atmlab-?.? (could not locate ChangeLog file)';
0035   return
0036 end
0037 
0038 s = '';
0039 %
0040 while isempty( findstr( s, 'atmlab-' ) )
0041   s = fgetl( fid );
0042   if ~ischar(s)
0043     error( 'Could not find any ''atmlab-'' in ChangeLog' );
0044   end
0045 end
0046 %
0047 fclose(fid);
0048 
0049 
0050 s = s( findstr(s,'atmlab-') : end );
0051 
0052 ind = find( s == '-' );
0053 
0054 s(ind(2:end)) = '.';
0055 
0056 if nargout==0
0057   
0058   fprintf('This is %s\n',s);
0059   clear s
0060 
0061 elseif nargout == 1
0062     varargout{1} = s;
0063 elseif nargout == 3
0064     varargout = cellfun(@str2num, strsplit(s(8:end), '.'), 'UniformOutput', false);
0065 end
0066 
0067 end

Generated on Mon 15-Sep-2014 13:31:28 by m2html © 2005