funZY = @(d) meshgrid(0:d:0.8660254, -0.5:d:0.5);
funS = @(z,y) (0.1069166660e0 .* (0.36e2 .* (z - sqrt(0.3e1) ./ 0.2e1) .^ 2 .* y .^ 2 + (0.3e1 .* y .^ 2 - z .^ 2 - 0.2e1 .* (z - sqrt(0.3e1) ./ 0.2e1) .* z) .^ 2) ./ (0.370370196e0 .* (z - sqrt(0.3e1) ./ 0.2e1) .* (0.3e1 .* y .^ 2 - z .^ 2) + 0.1e1) + 0.1e1) ./ (0.370370196e0 .* (z - sqrt(0.3e1) ./ 0.2e1) .* (0.3e1 .* y .^ 2 - z .^ 2) + 0.1e1);
funN = @(z,y) y<(-0.5773502692.*z) | y>(0.5773502692.*z);
[surfZ,surfY] = funZY(0.0005);
[gridZ,gridY] = funZY(0.05);
surfS = funS(surfZ,surfY);
gridS = funS(gridZ,gridY);
surfS(funN(surfZ,surfY)) = NaN;
gridS(funN(gridZ,gridY)) = NaN;
surf(surfZ, surfY, surfS,'FaceColor','interp','FaceLighting','phong','EdgeColor','none');
hold on
surf(gridZ, gridY, gridS,'FaceColor','none','FaceLighting','phong');
view(43,20)
Best Answer