function splash()
% splash
%   splash shows for 2 seconds the starting image of IMPACT and then it
%   closes down.

%   Project: IMPACT
%   Title of Code: controller_design
%   Relevant additional documentation:
%   Developer: Carlos Gonzalez
%   External Dependencies: NA
%
%   Disclaimer
%   CAUTION: It is strongly recommended that changes to this code
%   should be avoided without first consulting with authors.


% start up picture
import java.awt.*;
tk = java.awt.Toolkit.getDefaultToolkit();
ScreenDimens = tk.getScreenSize();
ScreenH = get(ScreenDimens,'Height');
ScreenW = get(ScreenDimens,'Width');

try
    str = fullfile(matlabroot,'toolbox','IMPACT','code', 'start.png');
    if exist(str,'file')
        
        I = imread(str); % path of the figure !!!!!!
        [figH figW bits] = size(I);
        fr=javax.swing.JFrame;
        fr.setUndecorated(1);
        fr.setLocation((ScreenW-figW)/2,(ScreenH-figH)/2)
        fr.setSize(figW, figH);
        javaImage = im2java(I);
        icon = javax.swing.ImageIcon(javaImage);
        label = javax.swing.JLabel(icon);
        fr.add(label);
        fr.pack
        fr.show
        pause(2);
    else
        return;
    end
end
fr.dispose
clear fr;