Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Plot the intersection of two 3d plot
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  
Triet

Posts: 3
Registered: 12/29/12
Plot the intersection of two 3d plot
Posted: May 20, 2013 9:51 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

I have two function z=f(x,y) and z=g(x,y) and I have plotted it but how can I plot the curve of intersection between those two?
And can you check my script below as well? Feel free to critic and edit it!
My program:

syms x y z;
g=@(x,y) -x-y-6;
..... (There're more things here but it doesn't matter).....
clf
hold on;
axis square;
t=-100:100;
funplot1=a.*sqrt(1+((t.^2)/(b.^2)));
[d1, d2, d3] =cylinder(funplot1);
h1=surf(d1,d2,d3,'LineStyle','-','FaceLighting','phong','EdgeAlpha',0.2,'FaceAlpha',0.4,'EdgeColor','red','FaceColor','yellow')
xr=-100:100;
yr=-100:100;
gz=ones(size(xr,2),size(yr,2));
for i=1:size(xr)
for j=1:size(yr)
end
end
for i=1:size(xr,2)
for j=1:size(yr,2)
gz(i,j)=f(xr(i),yr(j));
end
end
h2=surf(xr,yr,gz,'LineStyle','-','FaceLighting','phong','EdgeAlpha',0.2,'FaceAlpha',0.4,'EdgeColor','green','FaceColor','blue');
....(The intersection plot code should be here)...
end

I'm a newbie in Matlab so please help me!
Sorry for my poor English!
Thanks in advance!




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.