Surface drawing with inner and outer color

I am going to build a 3D surface in Matlab. I am using a function surf

, but I want to recolor it so that the inner surface has one color and the outer one another. How can i do this?

A = [12 18 12
     23 47 27
     32 11 36
     48 47 39
     28 50 28]
figure, surf(A)

      

+3


source to share


1 answer


See if this helps,

 surf(A+.01,'FaceColor',[ 1  0  1]);
 hold on; 
 surf(A,'FaceColor',[ 0  0  1]);

      

gives,

enter image description here



enter image description here

I couldn't think of a better performance!

This is just a trick, maybe there is a way to color each side of the plane.

+3


source







All Articles