(MATLAB ONLY) (MATLAB ONLY) (MATLAB ONLY) (MATLABONLY) (MATLAB ONLY) (MATLAB ONLY)
Please complete the following Question in MATLAB ASAP,Thanks. :)
2a. Write a function that outputs the amount of freezing pointdepression (in degrees C) given a mass of magnesium chloride saltand a volume of water. Formula to calculate freezing pointdepression: ΔT = iKm in which ΔT is the change in temperature in°C, i is the van't Hoff factor, which = 3 for MgCl2 because itdissociates into three ions, one Mg+2 and two Cl- , K is a constantthat equals 1.86 °C kg/mol and m is the molality of the solute inmol/kg. Other useful information so you don’t have to look it up:Moles of MgCl2 = (mass MgCl2)/((atomic mass Mg)+2*(atomic mass Cl))Atomic mass Mg = 24.31 Atomic mass Cl = 35.45 Assume the density ofwater is 1.0 g/mL
2b. Use your function to calculate the depression for 100g MgCl2dissolved in 500mL water
2c. Use your function to calculate the depression for 220g MgCl2dissolved in 1L water
2d. Make a plot that shows the mass of MgCl2 necessary todepress the freezing point of a given volume (range: 1L - 100L)water by 1 degree Celsius. Give your plot appropriate labels and atitle.