% JCALC file jcalc.m Calculation setup for joint simple rv % Version of 4/7/95 (Update of prompt and display 5/1/95) % Setup for calculations for joint simple random variables % The joint probabilities arranged as on the plane % (top row corresponds to largest value of Y) P = input('Enter JOINT PROBABILITIES (as on the plane) '); X = input('Enter row matrix of VALUES of X '); Y = input('Enter row matrix of VALUES of Y '); PX = sum(P); % probabilities for X PY = fliplr(sum(P')); % probabilities for Y [t,u] = meshgrid(X,fliplr(Y)); disp(' Use array operations on matrices X, Y, PX, PY, t, u, and P')