need help drawing ellipse PLEASE

2 views (last 30 days)
Ahsan Khan
Ahsan Khan on 24 Oct 2014
Commented: Image Analyst on 24 Oct 2014
hi guys
I am trying to draw the orbits of an asteroid and earth for an assignment. I am using the pdeellip tool to do his. I have all the info needed and have plotted it. but the problem that I am having is that how do I set the x y label of the axes, set min max axis values and also how do I make it so the ellipse drawn is just the border lines and not filled. any help would be greatly appreciated. thank you.
clear all
format long g
% eccentricity e_asteroid = 0.207598246; %given
e_earth = 0.01671123;
% Semi-major axis length
a_asteroid = 1.75; %AU calculated in part b
a_earth = 1; %AU
% Semi-minor axis length
b_asteroid = a_asteroid*(1-(e_asteroid^2))^0.5; %AU
b_earth = a_earth*(1-(e_earth^2))^0.5; %AU
pdeellip(0,0,a_earth,b_earth,pi/4,'Earth Orbit')
pdeellip(0,0,a_asteroid,b_asteroid,pi/4,'Asteroid Orbit')
  1 Comment
Image Analyst
Image Analyst on 24 Oct 2014
Read this: Also, enclosing your whole code in braces means you're trying to make all of that the contents of a cell, which would probably throw an exception. Read up on cell arrays here:, and another way to do ellipses in the FAQ:

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!