To plot half of an ellipse in MATLAB:
ellipse
function from the MATLAB FileExchange.main.m50 chars2 lines
a
and b
are the horizontal and vertical radii of the ellipse, respectively.x0
and y0
are the coordinates of the center of the ellipse.phi
is the angle of rotation of the ellipse (in degrees).linspace(0,2*pi)
specifies the range of angles for which to generate points on the ellipse.main.m20 chars2 lines
plot
function to plot the desired half of the ellipse:main.m34 chars2 lines
Putting it all together, we get:
main.m105 chars4 lines
This will plot the lower half of an ellipse with horizontal radius 3, vertical radius 2, centered at (0,0), and rotated 30 degrees counter-clockwise.
gistlibby LogSnag