View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Temperature Conversion Toolbox

5.0 | 1 rating Rate this file 8 Downloads (last 30 days) File Size: 5.32 KB File ID: #32218 Version: 1.1
image thumbnail

Temperature Conversion Toolbox



14 Jul 2011 (Updated )

Convert temperature between Fahrenheit, Celsius, Kelvin, and Rankine

| Watch this File

File Information

This toolbox contains 12 very simple functions that will convert between 4 very popular units of measure of temperature. The supported units are as follows:

  1. Fahrenheit
  2. Celsius
  3. Rankine
  4. Kelvin

These functions are called much like their distance-converting counterparts (i.e. nm2km, nm2sm, etc).

The convention for naming these functions are as follow:


where [unitsFrom] and [unitsTo] can be any one of the following tags:

  1. far (Fahrenheit)
  2. cel (Celsius)
  3. rank (Rankine)
  4. kel (Kelvin)

For example, to convert from Fahrenheit to Celsius.

  temp_far = 100;
  temp_cel = far2cel(temp_far);
Also included is a function called tempdim. This is very similar to MATLAB's distdim. It takes in the temperature, the units it is in, and the units you want to convert it to.

tempOut = tempdim(tempIn,unitsFrom,unitsTo)


This file inspired Unit Converters.

MATLAB release MATLAB 7.12 (R2011a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (1)
15 Jul 2011 Mike Sheppard

Mike Sheppard (view profile)

15 Jul 2011 1.1

Fixed misspelling in the comments of tempdim

Contact us