clc
clear
x = -10:0.5:10
y = -10:0.5:10
[X, Y] = meshgrid(x, y);
Z = X.^2 - 2*X.*Y + 4*Y.^2
figure
surf(X, Y, Z, 'EdgeColor', 'none')
hold on
contour3(X, Y, Z, 20, 'k')
xlabel('X-axis')
ylabel('Y-axis')
zlabel('Z-axis')
title('Surface Plot with Contour Plot')
view(3)
colorbar
hold off

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: