That's a start, but it's nowhere near what you want. Your function needs to create four nxn matrices of specific types, and then concatenate (join) them together to create the 2n x 2n matrix specified in your problem. To learn about matrices, see the section titled Working with Matrices in Ch. 2 in the link below. Also see the section titled Concatenation in Ch. 2 in the link below.
Here's a link to the Getting Started documentation for matlab: http://www.mathworks.com/access/helpdesk/help/pdf_doc/matlab/getstart.pdf
Comments on your code
A(2*n,2*n) = 0;
Sets one entry in matrix A to 0 and does nothing to any of the other entries. I'm sure that's not what you intended.
rand(n, n);
I believe this will create an nxn matrix of random numbers, but it needs to be an assignment statement to store them in a matrix variable. Here's how to do that.
Random_matrix = rand(n, n);
eye(n)
As above, this statement doesn't store the matrix variable anywhere. You can do it this way.
I_matrix = eye(n);
Now all you have to do is concatenete the n x n matrices that have created into the big 2n x 2n matrix.