Read this: http://www.mathworks.com/matlabcentral/answers/13205-tutorial-how-to-format-your-question-with-markup. 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: http://matlab.wikia.com/wiki/FAQ#What_is_a_cell_array.3F, and another way to do ellipses in the FAQ: http://matlab.wikia.com/wiki/FAQ#How_do_I_create_an_ellipse.3F
need help drawing ellipse PLEASE
3 次查看(过去 30 天)
显示 更早的评论
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
clc
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')
}
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Geometry and Mesh 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!