% Example 12-2: The gas equation % Initialize the variables global P T n a b R R = 0.08206; P = 6; T = 50 + 273.15; n = 2; a = 3.59; b = 0.047; % Estimate the V using the ideal gas equation Vest = n*R*T/P; % Solve the van der Waals equation V = fzero(@Waals, Vest)