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.)
13 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
%% 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 commentaires
John
le 3 Mai 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
le 5 Mai 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.
Réponses (1)
KSSV
le 30 Mar 2021
If X, Z are your Temperature and Relative Humidity arrays, use:
Td = X-((100 - Z)/5.) ;
0 commentaires
Voir également
Catégories
En savoir plus sur Text Files dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!