I am using this simple Matlab code to plot a 3d function. What is the best way to highlight the boundaries of the plot? (say by drawing a yellow line in the boundaries)

```
clc;
clear all;
syms x y;
func = x^2 + 4*y^2 - 2*x^2*y+4;
ezsurf(func, [-5,5]);
grid on;
box on;
```

# Best How To :

It is possible just using the `hold on/off`

:

1.Using **plot3**

```
clc; clear all;
syms x y;
func = x^2 + 4*y^2 - 2*x^2*y+4;
figure;
ezsurf(func, [-5,5]);
grid on;
box on;
hold on;
y1 = -5:0.1:5; x1 = 5.*ones(size(y1)); z1 = x1.^2 + 4*y1.^2 - 2*x1.^2.*y1+4;
y2 = -5:0.1:5; x2 = -5.*ones(size(y2)); z2 = x2.^2 + 4*y2.^2 - 2*x2.^2.*y2+4;
x3 = -5:0.1:5; y3 = 5.*ones(size(x3)); z3 = x3.^2 + 4*y3.^2 - 2*x3.^2.*y3+4;
x4 = -5:0.1:5; y4 = -5.*ones(size(x4)); z4 = x4.^2 + 4*y4.^2 - 2*x4.^2.*y4+4;
plot3(x1, y1, z1, 'y', x2, y2, z2, 'y', x3, y3, z3, 'y', x4, y4, z4, 'y');
hold off;
```

You can play with the LineWidth propriety to make this lines bigger.

Result:

2.Using **ezplot3** (parametric curves)

```
clear x y;
hold on;
x = {'5'; '(-5)'; 't'; 't'};
y = {'t'; 't'; '5'; '(-5)'};
for i = 1:size(x,1)
funz = [char(x(i)),'^2 + 4*',char(y(i)),'^2 - 2*',char(x(i)),'^2*',char(y(i)),'+4'];
h = ezplot3( char(x(i)), char(y(i)), funz, [-5, 5]);
set(h, 'Color', 'y', 'LineWidth', 2);
end
hold off;
```

Result: