PRINTCELSIUS Assumes input in degrees Fahrenheit. Prints degrees Celsius and Degrees Fahrenheit. Returns nothing. Provides an example of a function that takes an input but returns nothing. USAGE: printCelsius(212) ans = 100 history: v1.0 by R.Sonnenfeld, 9/4/2006
function printCelsius( F ) %PRINTCELSIUS Assumes input in degrees Fahrenheit. % Prints degrees Celsius and Degrees Fahrenheit. Returns nothing. % Provides an example of a function that takes an input but returns % nothing. % %USAGE: printCelsius(212) % ans = 100 % %history: v1.0 by R.Sonnenfeld, 9/4/2006 if length(F)>1 error('printCelsius expects only a single input Temperature (no vectors)'); end C=(5/9)*(F-32); fprintf('%7.2f F = %7.2f C\n',F,C) end