use matlab and the expected output should be in text file
Instructions: Answer Question 2 on this question paper. There are 2 printed pages for this question. Open book test The weather conditions affect pressure, altitude and density of air calculations, the pressure and temperature at sea level must be known. First layer of atmosphere (troposphere), the altitude at a given air pressure can be calculated using Equation 2.7 for a pressure to 22,632 Pa as well as for the density of air using Equation 2.2 H = h + Equation 2.1 PM RT Equation 2.2 where, Postatic pressure at sea level, 101,325 Pa To standard temperature at sea level, 288 K Ly - standard temperature lapse rate - -0.0065 K/m h = height about sea level, m hp = height at the bottom of atmospheric layer, m R= universal gas constant = 8.31432 Nm/kmolK g-gravitational acceleration constant - 9.80665 m/s2 M-molar mass of Earth's air -0.0289644 g/kmol Stratosphere layer is the second layer of atmosphere (from 22,632 to 2,485 Pa), have a constant temperature throughout the layer. This requires different equations to determine the altitude for a given pressure. Equations 2.3 and 2.4 specify the calculation for altitude and density of air respectfully in this zero temperature lapse rate layer. RT, in h = h + P = 9, exp[-a (h h))) -OM Equation 2.3 Equation 2.4 For Equations 2.3 and 2.4 where h - 11 km, P = 22,632 Pa, po =0.3648 and T, correspond to the altitude, pressure, density and temperature at the bottom of the stratosphere. The temperature at the bottom of the stratosphere is determined by subtracting 71.5 K from the temperature at sea level. Design a MATLAB programming using a decisional structure Switch-Case approach to calculate the atmosphere altitude and density of air at troposphere or stratosphere and display an error message if other option is inserted. Expected output should be altitude and density of