×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Hold on problem with 4 plots

Hold on problem with 4 plots

Hold on problem with 4 plots

(OP)
hi this may seem a basic question...
i have a geometry project and i have to draw an elliptical cone and elliptical cylinder.
I want first to draw the generators then use meshgrid as if to cover my skeleton.
But my elliptical cone "skeleton" won't draw with the others, each time it removes previous plots. And if i put it in head of script then it blocks the rest...
This is the script i am using: thank you for your help.

axis([-20 20 -20 20 -40 40]);
axis equal;
hold on;

a=20; % focal axe half-lenght for cone
b=12; % non focal axe half-axe for cone
k=[-1:1/30:1];
h=[-20:20/30:20];
for v=0:pi/100:2*pi
    z=20*ones(1,size(y,2));
    x=a*cos(v);
    y=b*sin(v);
    plot3(x,y,z)
    pause (10^(-20))
end
% draws the upper ellipse of the elliptical cone
for v=0:pi/100:2*pi
    z=-20*ones(1,size(y,2));
    x=a*cos(v);
    y=b*sin(v);
    plot3(x,y,z)
    pause (10^(-20))
end
% draws the lower ellipse of the elliptical cone
a2=16; % focal axe half-lenght for cylinder
b2=10; % non focal axe half-lenght for cylinder
u=[-20:20/30:20];
for v=0:pi/30:2*pi
    y=b2*sin(v);
    z=a2*cos(v);
    x=u;
    plot3(x,y,z,'r')
    pause(0.01)
end
% draws the generators of the ellipctical cylinder
for v=0:pi/30:2*pi
    z=u;
    x=a*k*cos(v);
    y=b*k*sin(v);
    plot3(x,y,z)
    pause(0.05)
end
% draws the generators of the elliptical cone (here's my problem)

Thank you for your time



Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources