function Y = uq_readNastranOutput(outputfilename)

% Keyword that identify the requested output
keyfatal = 'FATAL';
keyword = '   MODE    EXTRACTION      EIGENVALUE            RADIANS             CYCLES            GENERALIZED         GENERALIZED';
found = [] ;
% Open the output file
f = fopen(outputfilename) ;
if f < 0
    error('Something went wrong, the output file could not be opened') ;
end


% Read sequentially lines of the file until the keyword is found
while isempty(found)
	str = fgetl(f) ;
    if any(strfind(str,keyfatal))
        error('FATAL FOUND'); end
	found = strfind(str,keyword) ;
end

% Read the next 3 lines which are not of interest to us
for ii = 1:1
dummy = fgetl(f) ;
end
% Read the line corresponding to the Node 2 displacement
for i1 = 1:10
    myLine(i1,:) = fgetl(f) ;
end
% Split the line
for i1=1:10
MySplittedLine(i1,:) = strsplit(myLine(i1,:)) ;
end
for i1=1:10
% Get the output which corrsponds to the fourth element of the line
Y(i1) = str2num(MySplittedLine{i1,5}) ; %i' m choosing the radians
end
%Close the file for further processing in Matlab
fclose(f);
end