% TAPPR file tappr.m Discrete approximation to ac random variable % Version of 4/16/94 % Sets up discrete approximation to distribution for % absolutely continuous random variable X % Density is entered as a function of t r = input('Enter matrix [a b] of x-range endpoints '); n = input('Enter number of x approximation points '); d = (r(2) - r(1))/n; t = (r(1):d:r(2)-d) +d/2; PX = input('Enter density as a function of t '); PX = PX*d; PX = PX/sum(PX); X = t; disp('Use row matrices X and PX as in the simple case')