MATLAB MOLAR MASS Problem07 Using what you learnedwrote fro
MATLAB MOLAR MASS
% Problem{07}: Using what you learned/wrote from Homework_03 - Problem{08}
% (Molar mass calculator), modify the script to report the molar mass for
% the first ten alkanes.
% Filename: molar_mass_alkane.m
% Input: n (1 x 10)
% Output: molar_mass (1 x 10)
for n= 1:10
molar_mass = (12*n)+((1.01)*(2*n+2));
disp(molar_mass);
end
% Problem{08}: Modify the script in Problem{07} to calculate the molar mass
% for the first ten straight chain alcohols.
% Note: https://en.wikipedia.org/wiki/Functional_group
% Filename: molar_mass_alcohol.m
% Input: n (1 x 10)
% Output: molar_mass (1 x 10)
Solution
for n= 1:10
molar_mass = (12*n)+((1.01)*(2*n+1))+15.99+1.01;
disp(molar_mass);
end
