clear all
close all
delete probsetA.txt
diary probsetA.txt
echo on
% Your Name Here
% Matlab assignment #1
% Math 305

% Problem Set A

% #1. We practice doing some arithemtic.

% (a)

3 + 9

% (b)

2^123

% (c) We compute pi squared and e to 35 digits.

% Note you need the vpa command to do this. This has not been 
% installed on my machine. I have included what you need to do 
% as comments.

% pi^2 = vpa('pi^2',35)

% e = vpa('exp(1)',35)

% (d) Which of the fractions, 22/7, 311/99, 355/113, is the best appoximation to pi?
22/7
331/99
355/113
pi

% Clearly 355/113 is the best.

% #2. We numerically investigate the limit of sin(x)/x as x goes to zero. 

% We switch to long format to get 15 digits without having to use vps each time.
format long
x = [0.1, 0.01, 0.001];
y = sin(x)./x
format short

echo off
diary off
