%
%  rectangular_plate_entry_units.m  ver 1.3  April 9, 2013
%
function[a,b,h,rho,D,mass]=rectangular_plate_entry_units(E,rho,mu,iu)
%
disp(' ');
%
if(iu==1)
    length=input(' Enter the length (inch) ');
    width=input(' Enter the width (inch) ');
    thick=input(' Enter the thickness (inch) ');
else
    length=input(' Enter the length (m) ');
    width=input(' Enter the width (m) ');
    thick=input(' Enter the thickness (mm) ');
    thick=thick/1000;
end
%
area=width*length;
volume=area*thick;
%
a=length;
b=width;
h=thick;
%
smass=(rho*volume);
%
if(iu==1)
    smass=smass*386.;
end
%
disp(' ');
if(iu==1)
    out1=sprintf(' Structural mass = %8.4g lbm',smass);
else
    out1=sprintf(' Structural mass = %8.4g kg',smass);
end
disp(out1);
%
disp(' ');
disp(' Add non-structural mass ?');
disp(' 1=yes  2=no ')
imass=input(' ');
%
NSM=0;
if(imass==1)
  disp(' ');
  if(iu==1)
    disp(' Enter added mass(lbm) ');
  else
    disp(' Enter added mass(kg) ');      
  end
  NSM=input(' ');
end
%
mass=NSM+smass;
M=mass;
%
disp(' ');
if(iu==1)
    out1=sprintf(' Total mass = %8.4g lbm ',M);
else
    out1=sprintf(' Total mass = %8.4g kg ',M);    
end
disp(out1);
disp(' ');
if(iu==1)
    out1=sprintf(' Total mass density = %8.4g lbm/in^3 ',M/(a*b*h));
else
    out1=sprintf(' Total mass density = %8.4g kg/m^3 ',M/(a*b*h));    
end
disp(out1);
%
if(iu==1)
    mass=mass/386;
    M=M/386;
end
%
rho=M/volume;
%
D=E*h^3/(12*(1.-mu^2));
%
disp(' ');
if(iu==1)
    out1=sprintf(' Plate Stiffness Factor D = %8.4g (lbf in) ',D);
else
    out1=sprintf(' Plate Stiffness Factor D = %8.4g (N m) ',D);    
end
disp(out1);
%