anyToKelvin
PURPOSE
Takes input in degrees C, K, F, or R, and returns temperature in Kelvin.
SYNOPSIS
function [ K ] = anyToKelvin( Tin,inDegrees )
DESCRIPTION
CROSS-REFERENCE INFORMATION
This function calls:
This function is called by:
- tempConvert1 Same function as tempConvert, demonstrating use of functions instead of inline code.
SOURCE CODE
function [ K ] = anyToKelvin( Tin,inDegrees )
inDegrees=upper(inDegrees);
switch inDegrees
case('K')
K=Tin;
case('C')
K=Tin+273;
case('R')
F=Tin-459.67;
K=((5/9)*(F-32))+273;
case('F')
K=((5/9)*(Tin-32))+273;
otherwise
warning(['Invalid input units ',inDegrees])
end
Generated on Fri 07-Nov-2008 13:46:59 by m2html © 2005