function [x,y,t,u,px,py,p] = icalcf(X,Y,PX,PY) % ICALCF [x,y,t,u,px,py,p] = icalcf(X,Y,PX,PY) Function version of icalc % Version of 5/3/95 % Allows arbitrary naming of variables x = X; y = Y; px = PX; py = PY; if length(X) ~= length(PX) error(' X and PX of different lengths') elseif length(Y) ~= length(PY) error(' Y and PY of different lengths') end [a,b] = meshgrid(PX,fliplr(PY)); p = a.*b; % Matrix of joint independent probabilities [t,u] = meshgrid(X,fliplr(Y)); % t, u matrices for joint calculations