Using Matlab computer software, write the code to represent the next surface given by the following equation (put the title, axes and legend of the surface on the obtained graph) x² + y² – 2x – 6y – z + 10 = 0 (You can use a set of values between -5 to 5).
Provided the Matlab code to represent the surface given in above question as (which can also be written as ). Also the below given Matlab code put the title, axes and legend of the surface on the obtained graph as shown below.
Attached the snapshot of result generated after executing the below given Matlab program as shown in the attached snapshot.
Matlab Code :
x = -5:5;
y = -5:5;
[X, Y] = meshgrid(x, y);
% Rearranging the given equation as below
Z = X^2 + Y^2 - 2*X - 6*Y + 10;
% Plot the surface
surf(X, Y, Z);
zlim([-5 5])
% Putting legend of the surface
legend('z = x^2 + y^2 - 2x - 6y + 10');
% Putting title for surface
title('Plane Surface')
% Putting label for axes
xlabel('X');
ylabel('Y');
zlabel('Z');
Step by step
Solved in 2 steps with 1 images