%==========================================================================
% File Name     : <currentPOP.m>
% Usage         : version = currentPOP
% Description   : This function outputs the current version of POP.
%--------------------------------------------------------------------------
% Author        : Richard Oberdieck, Nikolaos A. Diangelakis, 
%                 Efstratios N. Pistikopoulos
% Office        : Engineering Research Building, Texas A&M University, USA
% Mail          : paroc@tamu.edu
%--------------------------------------------------------------------------
% Last Revision | Author  | Description
%---------------+---------+------------------------------------------------
% 14-Jun-2016   | RO      | Initial Version
%==========================================================================

function version = currentPOP

% Get current version of POP
fid = fopen('POP.m');
C = textscan(fid,'%s');
fclose(fid);
lsfile = C{1};

for i = 1:20
    if isempty(strfind(lsfile{i},'POP'))
        version = str2num(lsfile{i});
        if ~isempty(version)
            break
        end
    end
end
end