There are a few problems on Cody regarding temperature conversion (C to K, C to F, F to C), but none include Rankine. Furthermore, they each involve simple one-liner solutions. For this problem, you are to write a utility function that takes a given temperature and two capital letters designating which temperature scale is being converted to which. For example, T_convertor(100,'C','F') requires 100 degrees Celsius be converted to Fahrenheit.
The test suite includes all 16 possible combinations: C to F, C to R, C to C, C to K, K to F, K to R, etc. (Yes, the redundant combinations are included.)
For reference, temperature conversion formulas are available at http://en.wikipedia.org/wiki/Temperature_conversion.
A follow-on problem (more difficult with string inputs) is located here: http://www.mathworks.com/matlabcentral/cody/problems/2415-temperature-conversion-utility-strings.
Solution Stats
Problem Comments
Solution Comments
Show commentsProblem Recent Solvers48
Suggested Problems
-
Find state names that end with the letter A
1197 Solvers
-
Find the peak 3n+1 sequence value
2565 Solvers
-
It dseon't mettar waht oedrr the lrettes in a wrod are.
2082 Solvers
-
"Low : High - Low : High - Turn around " -- Create a subindices vector
583 Solvers
-
511 Solvers
More from this Author139
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!