function TinK=at(t)
% at		- Converts temperatures to Kelvin
% function TinK=at(t)
% AT  uses the global variable Tdeg
% 	to convert its argument to Kelvin if  
% 	the user has specified temperature
% 	in another unit.
% Example: >> Tdeg='C'
%          >> at(25)
% 	would give: 298.15 as ans.
% See also ATK
% OKB, revised help by TYLC

global Tdeg
if Tdeg=='K'
   TinK=t;
elseif Tdeg=='C'
   TinK=t+273.15;
elseif Tdeg=='F'
   TinK=(t+459.67)/1.8;
elseif Tdeg=='R'
   TinK=t/1.8;
else
   disp('Tdeg is not set correctly; it should be K, C, F or R.')
end
