clc
clear
x = linspace(-1, 1, 100); % 100 points in [-1, 1]
y = linspace(-1, 1, 100);
[X, Y] = meshgrid(x, y);
Z = sin(X.^2 + Y.^2) .* exp(-5 * X.^2 - Y.^2);
figure;
subplot(1, 2, 1);
surf(X, Y, Z);
title('Surface Plot');
xlabel('x');
ylabel('y');
zlabel('f(x, y)');
subplot(1, 2, 2);
contour(X, Y, Z, 20);
title('Contour Plot');
xlabel('x');
ylabel('y');
colormap jet
colorbar
To embed this project on your website, copy the following code and paste it into your website's HTML: