function prntfreq
%
%  Name:   prntfreq.m
%
%  Usage:  prntfreq.m
%
%  Prints a table of the identified modes and frequencies
% 

%  Version SWD980625
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This matlab source code was originally     %
% developed as part of "DIAMOND" at          %
% Los Alamos National Laboratory. It may     %
% be copied, modified, and distributed in    %
% any form, provided:                        %
%  a) This notice accompanies the files and  %
%     appears near the top of all source     %
%     code files.                            %
%  b) No payment or commercial services are  %
%     received in exchange for the code.     %
%                                            %
% Original copyright is reserved by the      %
% Regents of the University of California,   %
% in addition to Scott W. Doebling, Phillip  %
% J. Cornwell, Erik G. Straser, and Charles  %
% R. Farrar.                                 %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%   

global MODES

disp(' ')
disp(' ')
disp(' ')
if isfield(MODES,'filename')
   disp([' Identified Modes for ',MODES.filename])
else
   disp(' Identified Modes')
end

prtstr = sprintf(' %4s %10s %10s','Mode','Freq (Hz)','Damp (%)');

for i = 1:MODES.nmodes,
   prtstr = [prtstr; sprintf(' %4d %10.3f %10.3f',i,MODES.Freq{i},MODES.Damp{i}*100)];
end

tp = size(prtstr,2);

prtstr = [blanks(tp);blanks(tp);prtstr;blanks(tp);blanks(tp)];

disp(prtstr)

%  See if statistical analysis results are present

if isfield(MODES,'Freq95CI'),
   
    freqstr = sprintf('\n%-20s\n%7s%13s%15s%15s \n','Frequency Statistics','Mode #','Mean (Hz)','Abs 2Sig (Hz)','Rel 2Sig (%)');

    for i=1:length(MODES.Freq95CI)
       std2frqabs(i) = MODES.Freq95CI{i};
       std2frqrel(i) = MODES.Freq95CI{i}/MODES.Freq{i};
       freqstr = [freqstr, sprintf('%7i   %0.3e  %0.3e      %0.3e \n',...
             i,MODES.Freq{i},std2frqabs(i),std2frqrel(i)*100)];
    end

    disp(freqstr)
    
end

%
%  Build string of damping statistics
%

if isfield(MODES,'Damp95CI'),
   
   dampstr = sprintf('\n%-20s\n%7s%13s%15s%15s \n','Damping Statistics','Mode #','Mean (%)','Abs 2Sig (%)','Rel 2Sig (%)');

    for i=1:length(MODES.Damp95CI)
       std2dmpabs(i) = MODES.Damp95CI{i};
       std2dmprel(i) = MODES.Damp95CI{i}/MODES.Damp{i};
   	dampstr = [dampstr, sprintf('%7i   %0.3e   %0.3e     %0.3e \n',...
         i,MODES.Damp{i}*100,std2dmpabs(i)*100,std2dmprel(i)*100)];
    end
    
   disp(dampstr)
   
end


return
   