File Exchange

image thumbnail

convert_humidity

version 1.1.0.0 (242 KB) by Felipe G. Nievinski
Convert humidity between different formats.

7 Downloads

Updated 16 Apr 2011

View License

Convert humidity between any two of the following formats:
- partial pressure of water vapor
- specific humidity
- mixing ratio
- relative humidity
- dew point temperature
- virtual temperature

Cite As

Felipe G. Nievinski (2020). convert_humidity (https://www.mathworks.com/matlabcentral/fileexchange/30553-convert_humidity), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (9)

Riley Toll

peng bai

When I wrote a function based on the equations on the books, I also get RH values larger than 100%, even up to 175%. The RH values are similar with that by Felipe's function, I mean, this program should be at least theoretically right.

peng bai

RH from this function can be over 100%....

Felipe

@Andre: garbage in, garbage out? Please specify your input.

Andre

This code is crap. RH values should not exceed 100% by more than 1% ever. Thanks but no thanks

Felipe G. Nievinski

@hosseini: please take a look at the tests included in the bottom of file convert_humidity.m. For example, to convert specific humidity (s) to relative humidity (r) you'd do:
r = convert_humidity (P, T, s, 'specific humidity', 'relative humidity');
where P and T stands for pressure and temperature.

hosseini

dear Felipe
I added the functions to my MATLAB but I don't know how to use the functions and syntaxes.Please help me.

cheers

Katie

I used this function to convert from specific humidity to relative humidity. A few of my values (about 6%) were above 100% relative humidity. The data I am using is straight from CMIP5, and has not been altered. All the variables are in the correct units. Any idea why I have impossible above 100% values?????? (there are some that are 100.2% and others that are 120%). The rest of the values look normal around 60 - 90 percent.

Updates

1.1.0.0

Included PDF describing formulation; applied more tags.

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