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.
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.
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