% Problem 1 clear close all % a) 3+9 ans = 12 % b) 2^123 ans = 1.0634e+037 % This is a floating point approximation to 2^123. We can force all % of the digits of this integer to be displayed by converting one of % the numbers to a symbolic expression. sym('2')^123 ans = 10633823966279326983230456482242756608 % c) % We use vpa to display 35 digits of pi^2. vpa('pi^2', 35) ans = 9.8696044010893586188344909998761512 % Unlike pi, e is not predefined in MATLAB, but we can generate it by % taking the exponential of 1. vpa('exp(1)', 35) ans = 2.7182818284590452353602874713526625 % d) a = 22/7 a = 3.1429 b = 311/99 b = 3.1414 c = 355/113 c = 3.1416 a - pi ans = 0.0013 b - pi ans = -1.7851e-004 c - pi ans = 2.6676e-007 % We see that 355/113 is the best approxinmation to pi. echo off diary off