% MatLab script for part 2 of the question for the CSC 336 tutorial % on 29 Sept. 2007. % % This script computes prints the terms x^k/k! for k = 1,2,3,... and x = 20 % % K.R.J. 24 Sept. 2007 values = zeros(50,2); x = 20; term = 1; for k = 1:50, term = term * x / k; values(k,1) = k; values(k,2) = term; end format long e values exp(-20)