I have an array of temperatures that start from 0 and go to 50. The array goes in increments of 10. So I have declared,
T=0:10:50
I have another array which are the relative humidity’s that goes from 10 to 100. I have this set to go in increments of 10.
RH=10:10:100
If I want to find the dew point at each temperature, I have to consider each of the following relative humidity’s too. How do I incorporate each element of the temperature array with each element of the relative humidity array in the equation? Dewpoint =
DewpointT= T -(100-RH/5)
. I thought I would use meshgrid, but I was getting negative values.

回答 (1 件)

Matt J
Matt J 2021 年 4 月 1 日
編集済み: Matt J 2021 年 4 月 1 日

0 投票

DewpointT= T(:) - (100-RH/5)

3 件のコメント

Monica Padykula
Monica Padykula 2021 年 4 月 1 日
My dewpoints are still negative.
Steven Lord
Steven Lord 2021 年 4 月 1 日
That is correct, given the formula you stated. When T is 0 and RH is 10:
T = 0;
RH = 10;
D = T - (100-RH/5)
D = -98
Even if you meant to divide (100-RH) by 5 rather than subtracting RH/5 from 100, it's still negative. In this case you're still subtracting something positive from 0 and that's going to give you a negative value.
D = T - (100-RH)/5
D = -18
Negative depoints can occur normally.
Matt J
Matt J 2021 年 4 月 1 日
If you need to keep only non-negative values, do
DewpointT(DewpointT<0)=[];
or
DewpointT(DewpointT<0)=nan;

サインインしてコメントする。

カテゴリ

ヘルプ センター および File Exchange で Image Processing Toolbox についてさらに検索

質問済み:

2021 年 4 月 1 日

コメント済み:

2021 年 4 月 1 日

Community Treasure Hunt

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

Start Hunting!

Translated by