Downloads data tables from the NIST Chemistry Webbook (http://webbook.nist.gov/chemistry/fluid/) for a specified temperature and/or pressure range. The tables are useful for plotting or for data lookup by interpolation.
Are Mjaavatten (2020). nistdata(species,T,p) (https://www.mathworks.com/matlabcentral/fileexchange/64578-nistdata-species-t-p), MATLAB Central File Exchange. Retrieved .
You are absolutely right, Alexandra. At some point I changed the unit read from NIST from micro Pa/s to Pa/s, but kept the old conversion factor. I seldom use transport properties, so this blatant error passed under the radar. Thank you for pointing this out. The new version (1.4) should be correct.
I think your unit conversions are incorrect. I am getting a viscosity on the order of 1e-11 Pa-s
Thanks to Martijn van Heumen for his constructive comment. The code has been updated accordingly in version 1.3.
The file did not work for me under R2018b. After replacing txt = webread(url); by options = weboptions('RequestMethod','get','ArrayFormat','csv','ContentType','text'); txt = webread(url,options); it works perfectly.
Corrected serious unit conversion error in viscosity.
Corrected code for downloading data, according to the comment by Martijn van Heumen.
For Matlab versions older that R2017b, I now use Python (2.7 or 3.x) as a workaround to read the secure (https) web pages from NIST. See the readme.txt file for details. I welcome feedback on how this works for you!
nistdata ceased to work after NIST upgraded to the https protocol. I have updated the file so that it will hopefully work in Matlab 2017b and later, but my Matlab licence is too old to test this.