MATLAB: How to graph a vertical hemisphere with a radius of 1 and center of (0,0,0) in MATLAB

hemisphere

I've got a restriction to not include any negative x values in the hemisphere, that's why it's vertical. I found this online but I'm not sure how I can edit it to get what I want…
[x,y,z] = sphere; %# Makes a 21-by-21 point sphere
x = x(11:end,:); %# Keep top 11 x points
y = y(11:end,:); %# Keep top 11 y points
z = z(11:end,:); %# Keep top 11 z points
r = 1; %# A radius value
surf(r.*x,r.*y,r.*z); %# Plot the surface
axis equal; %# Make the scaling on the x, y, and z axes equal

Best Answer

Use the rotate (link) function to change the orientation of the hemisphere. (There are two rotate functions in core MATLAB, and others in Toolboxes. Use the one I linked to here.)
Example
[x,y,z] = sphere; %# Makes a 21-by-21 point sphere
x = x(11:end,:); %# Keep top 11 x points
y = y(11:end,:); %# Keep top 11 y points
z = z(11:end,:); %# Keep top 11 z points
r = 1; %# A radius value
hs = surf(r.*x,r.*y,r.*z); %# Plot the surface
direction = [0 1 0]; % Specify Direction
rotate(hs, direction, 90) % Rotate The Object (Hemisphere) in ‘Direction’ By 90°
axis equal; %# Make the scaling on the x, y, and z axes equal
Ax = get(gca); % Axes Handle
XD = Ax.Children.XData; % Get ‘XData’
Ax.Children.XData = XD + 0.5; % Add 0.5 To ‘XData’ To Shift It To All > 0
Experiment to get the result you want.