How Do I calculate the Dew Point from the Temperature and Relative Humidity. The equation I need to use is: Td = T - ((100 - RH)/5.)
8 views (last 30 days)
Show older comments
%% Import data from text file
% Script for importing data from the following text file:
%
% filename: C:\Users\smctu\OneDrive\Documents\School\Remote Sensing\sonde_data.txt
%
% Auto-generated by MATLAB on 18-Mar-2021 01:23:08
%% Setup the Import Options and import the data
opts = delimitedTextImportOptions("NumVariables", 7);
% Specify range and delimiter
opts.DataLines = [4, Inf];
opts.Delimiter = " ";
% Specify column names and types
opts.VariableNames = ["FltTime", "Press", "Temp", "RelHum", "WSpeed", "WDirn", "GPM_AGL"];
opts.VariableTypes = ["double", "double", "double", "double", "double", "double", "double"];
% Specify file level properties
opts.ExtraColumnsRule = "ignore";
opts.EmptyLineRule = "read";
opts.ConsecutiveDelimitersRule = "join";
opts.LeadingDelimitersRule = "ignore";
% Import the data
sondedata = readtable("C:\Users\smctu\OneDrive\Documents\School\Remote Sensing\sonde_data.txt", opts);
figure
subplot(2,1,1)
X=sondedata.Temp+273.15
Y=sondedata.GPM_AGL
Z=sondedata.RelHum
plot(X,Y,'r')
hold on;
plot(X,Z,'b-')
xlabel("Temperature(K)")
ylabel("Altitude(km)")
ylim([0,25000])
yticks(0:5000:30000)
clear opts
4 Comments
John
on 3 May 2025
ok got it..... I just need to point this to my data file.
will this calculator work for temperatures down in the -100 C
thanks,
Walter Roberson
on 5 May 2025
The code does not do any meaningful caclulation. The most it does is convert celcius input to Kelvin value. The formula for that conversion is still valid at -100 C.
Answers (1)
KSSV
on 30 Mar 2021
If X, Z are your Temperature and Relative Humidity arrays, use:
Td = X-((100 - Z)/5.) ;
0 Comments
See Also
Categories
Find more on Text Files in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!