Using
rand(N,1)<p %# 0 < p < 1
will give you a Nx1 vector with on average N*p ones in it (and other places will be zero) - but on some runs you might get a vector that is different than what you expect (it might have all zeros for example... might be a very low chance, but still non zeros chance).
If you want exactly A ones and B zeros, you can do this:
rand_vec = [ones(A, 1); zeros(B, 1)];
rand_vec = rand_vec(randperm(A+B));
Then you can set A and B to match your needs.
EDIT:
Now I understood your question better:
Lets say you have a vector p which contains the wanted proportions of 1's in your population, N is the number of elements in each vector.
rand_mat = rand(N, size(p,2)) < repmat(p', [1,N])';
Will give you a Nx(size(p,2)) matrix where column i is a vector with p(i) ones (on average as explained above) and the rest is zeros.