Mohammad - rand is the name of a built-in MATLAB function so you shouldn't be using it as the name of a local variable. As for which sub-matrix does the RNG value belong to, you can just use the index into z to determine that. For example, if
z = [a;b;c];
randValues = randperm(size(z,1));
RNG = z(randValues(1),:);
then the index into z is
randIndex = randValues(1);
Now if we consider the number of elements of each sub-matrix, then we can determine the upper bound on each sub-matrix with respect to the index into z as follows
subMatricesIdcsUpperBounds = cumsum([length(a) length(b) length(c)]);
4 9 11
We can interpret the above as a corresponding to indices 1 through 4 into z, b corresponding to indices 5 through 9 of z, and c corresponding to indices 10 through 11 of z.
Then we just do
find(randIndex <= subMatricesIdcsUpperBounds,1)
which returns an index k which tells us that RNG can be found in the kth sub-matrix.