- #1
maiad911
- 2
- 0
Homework Statement
i'd try to write the code for this question :(Discrete random variable X & Y have a joint distribution : Fx,y(x,y)=0.1u(x+4)u(y-1)+0.1u(x+3)u(y+5)+0.17u(x+1)u(y-3)+0.05u(x)u(y-1)+0.18u(x-2)u(y+2)+0.23u(x-3)u(y-4)+0.12u(x-4)u(y+3)
Homework Equations
I try this code in MATLAB but it doesn't work :
>> x=[-4 -3 -1 0 2 3 4];
>> y=[1 -5 3 1 -2 4 -3];
>> [X Y] = meshgrid(x,y);
>> Z =0.1.*heaviside(x+4).*heaviside(y-1)+0.15.*heaviside(x+3).*heaviside(y+5)+0.17.*heaviside(x+1).*heaviside(y-3)+0.05.*heaviside(x).*heaviside(y-1)+0.18.*heaviside(x-2).*heaviside(y+2)+0.23.*heaviside(x-3).*heaviside(y-4)+0.12.*heaviside(x-4).*heaviside(y+3);
The Attempt at a Solution
please can you figure where is the problem ?