Consider the 3d graph of a quadratic form: 1/2*trans(x)*A*x-trans(b)*x(adsbygoogle = window.adsbygoogle || []).push({});

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.

**Physics Forums - The Fusion of Science and Community**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# MATLAB: Adding 2d plot to 3d surface

Can you offer guidance or do you also need help?

Draft saved
Draft deleted

Loading...

Similar Threads - MATLAB Adding plot | Date |
---|---|

Matlab Coding angular spectrum of waves in a fluid | Thursday at 7:30 AM |

Matlab ode solvers - adding a separate convergence criteria | Dec 10, 2015 |

Adding code in box on the forum | Jun 9, 2014 |

[Matlab] Gui help for adding code | Jun 4, 2014 |

Adding other function calls in GUI Matlab | Sep 23, 2011 |

**Physics Forums - The Fusion of Science and Community**