Help me about sphere ?

1 view (last 30 days)
Nguyen Trong Nhan
Nguyen Trong Nhan on 27 May 2014
Commented: Nguyen Trong Nhan on 27 May 2014
I have this code to draw haft of sphere x^2 + y^2 + z^2 = 1, z>0. but it have error. help me to fix it. thanks very much.

Answers (1)

Mischa Kim
Mischa Kim on 27 May 2014
Edited: Mischa Kim on 27 May 2014
Nguyen, use instead
z = real(sqrt(1 - x.^2 - y.^2));
to retain the real part only.
  3 Comments
Nguyen Trong Nhan
Nguyen Trong Nhan on 27 May 2014
ah Mischa Kim, could you explain me when I need to use the eval and double funtions in matlab ?

Sign in to comment.

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by