I am going to plot a 3D surface in matlab. I use the surf function, but I want to recolor it in a way that the inner surface has one color and the outer has another one. How can I do that?
A = [12 18 12
23 47 27
32 11 36
48 47 39
28 50 28]
figure, surf(A)
See if this helps,
surf(A+.01,'FaceColor',[ 1 0 1]);
hold on;
surf(A,'FaceColor',[ 0 0 1]);
gives,


I couldn't come up with better idea!
This is just a trick, maybe there is a way to color each side of a plane.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With