function htcal
%we nedd phe and n b
h1=findobj(0,'tag','now');
m=findobj(h1,'tag','EditText2');
phe=get(m,'string');
phe=str2num(phe)
h2=findobj(0,'tag','ht');
t=findobj(h2,'tag','EditText1day');
nk=get(t,'string');
n=str2num(nk)
tl=findobj(h2,'tag','EditText2slop');
bk=get(tl,'string');
b=str2num(bk)
if strcmp(nk,'')|strcmp(bk,'')
msgbox('you should enter all required data')
else
brad=b*3.14/180;
phe=phe*3.14/180;
dece=23.45*sin(360*(n+284)*3.14/(180*365));
sunset1=(180/(3.14*15))*acos(-(tan(phe*3.14/180))*tan(dece*3.14/180));
sunset2=(180/(3.14*15))*acos(-(tan((phe*3.14/180)-brad))*tan(dece*3.14/180));
sunset=min(sunset1,sunset2);
hot=(24*3600*1367/3.14)*(1+0.033*cos(360*3.14*n/(365*180)))*(cos(phe-brad)*cos(dece*3.14/180)*sin(sunset*3.14/180)+((2*3.14*sunset)/360)*sin(phe-brad)*sin(dece*3.14/180))
msgbox(num2str(hot),'total day radiation')
end