To plot half of an ellipse in MATLAB with a = 40
and b = 20
, first create a parameterized equation for the ellipse. Here is the equation:
main.m30 chars3 lines
Next, use the plot
function to plot the ellipse from t = -pi/2
to t = pi/2
:
main.m70 chars5 lines
This will plot half of the ellipse, with the major axis of length 80 along the x-axis and the minor axis of length 40 along the y-axis.
gistlibby LogSnag