The simple answer, as long as the vector x IS an eigenvector. is just:
You should see that this is not a problem if x has some zero entries, as long as x is not the vector that is entirely zero.
If x is not an eigenvector, then of course it won't work, but we are told that x is an eigenvector so there is no problem. Ok, it does assume that the eigenvalue in question is real. If that is an issue, then a simple solution is still available. For example:
A = rand(5);
[V,D] = eig(A);
2.80100746971912 + 0i
0.396075677494192 + 0.0659443099214011i
0.396075677494192 - 0.0659443099214011i
-0.322864111476007 + 0i
-0.285307095833035 + 0i
Now, can we recover the first eigenvalue? It is real.
Of course, that will fail for the second eigenvalue. But only you know if the eigenvalues and eigenvectors are real in your problem.
Just pick the largest element in magnitude of the corresponding eigenvector.
V2 = V(:,2);
[~,ind] = max(abs(V2));
Av2 = A*V2;
val = Av2(ind)/V2(ind)
0.396075677494192 + 0.0659443099214012i
Indeed, we have recovered the eigenvalue. Again, this is not a problem if the eigenvector has SOME zero elements, because I picked a specific element that is known to be non-zero.