Side note: you do not need surf() and then plot3(). You can use
surf( X, Y, Z, 'EdgeColor', 'black', 'FaceColor', [255,100,0]/255, 'FaceAlpha', .5, 'Marker', '.' );
To legend appropriately, you would use
h1 = surf( X, Y, Z, 'EdgeColor', 'black', 'FaceColor', [255,100,0]/255, 'FaceAlpha', .5, 'Marker', '.' );
and later
h2 = surf( X, Y, Z2, 'EdgeColor', 'black', 'FaceColor', [1,255,200]/255, 'FaceAlpha', .9, 'Marker', '.');
and then
legend([h1, h2], {'First Surface', 'Second Surface'});
Best Answer