Is the z-axis in a Sphere only positive?

1 view (last 30 days)
[X, Y, Z] = sphere(10);
Points = [X(:), Y(:), Z(:)].';
plot3(Points(1,:), Points(2,:), Points(3,:), 'x');
I want to get points by representing only the positive z-axis.

Accepted Answer

Chunru
Chunru on 5 Sep 2022
Edited: Chunru on 5 Sep 2022
No. It consists of both positive and negative parts.
[X, Y, Z] = sphere(100);
Points = [X(:), Y(:), Z(:)].';
%plot3(Points(1,:), Points(2,:), Points(3,:), 'x');
surf(X, Y, Z)
whos
Name Size Bytes Class Attributes Points 3x10201 244824 double X 101x101 81608 double Y 101x101 81608 double Z 101x101 81608 double cmdout 1x33 66 char
figure
idx = 51:101;
surf(X(idx, :), Y(idx, :), Z(idx, :))
  2 Comments
민제 강
민제 강 on 5 Sep 2022
So, I want to make it a hemisphere with only positive values on the z-axis.

Sign in to comment.

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!