MATLAB: Create composite 3d plot

3d plot composite surface

I have a 3d plot of a function fly(S, t) that returns the theoretical value for a butterfly position by underlier price (S) and time to expiration (t).
[X, Y] = meshgrid(500:5:720, 0:0.2/252:5/252);
Z=fly(X, Y);
surf(X, Y, Z|)
However, I'd like to add a black line on the surface that traces the values for fly(S, t=1/252) – i.e. the theo values one day prior to expiration.
Is there a way to create composite 3d plots with additional functions being plotted? I haven't done an exhaustive search of the manual, sorry if this is a noob question.

Best Answer

OK - a little more searching and I think I found out how to do this:
[X, Y] = meshgrid(500:5:720, 0:0.2/252:5/252);
Z=fly(X, Y);
surf(X, Y, Z)
hold on
[X1, Y1] = meshgrid(500:5:720, 1/252:0.02/252:1.1/252);
Z1=fly(X1, Y1);
surf(X1, Y1, Z1)
hold off
Related Question