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 (최근 30일)
%% 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
John
John 2025년 5월 3일
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
Walter Roberson 2025년 5월 5일
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.

댓글을 달려면 로그인하십시오.

답변 (1개)

KSSV
KSSV 2021년 3월 30일
If X, Z are your Temperature and Relative Humidity arrays, use:
Td = X-((100 - Z)/5.) ;

카테고리

Help CenterFile Exchange에서 Text Files에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by