File Exchange

image thumbnail

Calculation of air properties

version 2.0.1 (29.7 KB) by SFitz
Calculates a variety of the thermodynamic properties of humid air.


Updated 18 Nov 2020

From GitHub

View Version History

View license on GitHub

Calculates a variety of air thermodynamic properties from the measured temperature, pressure, and humidity.

Variables able to calculated:
rho - [kg m^-3] - Density
mu - [N s m^-2] - Dynamic viscosity
k - [W m^-1 K^-1] - Thermal conductivity
c_p - [J kg^-1 K^-1] - Specific heat capacity (constant pressure)
c_v - [J kg^-1 K^-1] - Specific heat capacity (constant volume)
gamma - [1] - Ratio of specific heats
c - [m s^-1] - Speed of sound: c = (gamma*R*T/M)^0.5
nu - [m^2 s^-1] - Kinematic viscosity: nu = mu/rho
alpha - [m^2 s^-1] - Thermal diffusivity: alpha = k/(rho*c_p)
Pr - [1] - Prandtl number: Pr = mu*c_p/k
M - [kg mol^-1] - Molar mass of humid air
R - [J kg^-1 K^-1] - Specific gas constant
h - [%] - Relative humidity (if dew point inputted)

Calculations are based around atmospheric temperatures and pressures, i.e. not for the use of high temperature combustion. See references for details and limitations.

Picard, A, Davis, RS, Glaser, M, Fujii, K, 2008, 'Revised formula for the density of moist air (CIPM-2007)', Metrologia, vol. 45, no. 2, pp. 149-155. DOI:

Tsilingiris, P, 2008, 'Thermophysical and transport properties of humid air at temperature range between 0 and 100°C', Energy Conversion and Management, vol. 49, no. 5, pp.1098-1110. DOI:

Cite As

SFitz (2021). Calculation of air properties (, GitHub. Retrieved .

Comments and Ratings (3)

mousa alsaeed

Thank you so much it really helps me a lot in my graduation project


The aim is to input measured values of temperature/pressure/humidity and calculate the required air properties. There is a detailed explanation in the function help, but put simply: [rho, mu] = AirProperties(25, 1010, 50, 'rho','mu'); will return the air density (rho) and dynamic viscosity (mu) at 25 deg C, 1010 hPa and 50% humidity.

Shreyas Taware

Can you show me an example how to use the software

MATLAB Release Compatibility
Created with R2018a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!