If you have the vectors x and y
e.g.
x = 0.5 * rand(10, 1);
y = 0.5 * rand(10, 1);
Then the z is simply
z = sqrt(1 - x.^2 - y.^2);
plus or minus that, depending if you want the positive or the negative root.
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!