Add line in combined surface-plot where surfaces cross

1 view (last 30 days)
Using the hold function I plot two surfaces in a surface-plot:
surf(A,'linestyle','none')
hold on
surf(B,'linestyle','none')
hold off
Where A and B are two-dimensional matrices. I turned off the contour lines because I use a colormap with 512 colors, and then the graph will become black. Now since the two surfaces cross each other, I want to add a line of desired color to be plotted where A-B=0 such that the crossing becomes clear.
  1 Comment
Shane
Shane on 18 Sep 2012
Bjorn, have you referenced the following topic? It discusses how to plot the intersection with three different cases of surface definitions. It does seem to conclude that you must have at least one explicitly defines durface in order to perform the intersection derivation. However, I believe that if your matricies are of identical size you may be able to perform the derivation but it will be very dependent upon how fine your mesh is and the inherent error that is present in a z1-z2=0 calculation at large intervals of x and y. I hope this helps.

Sign in to comment.

Answers (0)

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!