MATLAB: Adding 2d plot to 3d surface

  • MATLAB
  • Thread starter gysush
  • Start date
  • #1
26
0

Main Question or Discussion Point

Consider the 3d graph of a quadratic form: 1/2*trans(x)*A*x-trans(b)*x

Plot via matlab: surfc(X,Y,Z);

add following lines:
hold on
x=-10:10;
y=0.5*(2-3*x);
plot(x,y);

This plot a straight line which intersects the 3d surface. However, I wish for it be graphed on the contours: i.e. the 3d graph has contours where Z=-200. The plot(x,y) plots the straight line on the z=0 plane. I wish for it graph the straight line on the z=-200 plane.

I've considered doing a loops such that I graph single points for the z=-200 plane.

Thank you.
 

Answers and Replies

Related Threads on MATLAB: Adding 2d plot to 3d surface

  • Last Post
Replies
1
Views
2K
  • Last Post
Replies
4
Views
14K
  • Last Post
Replies
6
Views
105K
  • Last Post
Replies
1
Views
2K
Replies
2
Views
6K
  • Last Post
Replies
4
Views
8K
  • Last Post
Replies
1
Views
2K
Replies
3
Views
4K
Top