Sorry, I inadvertently deleted my earlier response.
So I'm assuming you want an array with
y1 x1 z11
y2 x2 z21
y3 x3 z31
y1 x2 z12
y2 x2 z22
This isn't the way you have it in your original question but maybe you just didn't type it correctly.
It could probably be vectorized (avoid a loop) but here is how you could do it with a loop
[numRows,numCols] = size(Z)
Ztbl = zeros(numRows*numCols,3)
row = 1
for j = 1:numCols
for i = 1:numRows
Ztbl(row,:) = [y(i) x(j) Z(i,j)]
row = row+1