%Calculating Atmopsheric Pressure - input asl to run
%Author: Tom D Pering - University of Sheffield
%You are free to use and alter with acknowledgement
function atmP=atmPressure (asl)
%asl = above sea level
slp=101325; %sea level standard pressure
slt=298.15; %sea level standard temperature
tlr=0.0065; %temperature lapse rate
mmDA=0.0289644;
g=9.81; %acceleration due to gravity;
R=8.3144621; %universal gas constant
atmP=slp*(1-((tlr*asl)/slt))^((g*mmDA)/(R*tlr));
clear slp slt tlr g R mmDA
end