Solution: Do not use ezmesh
or ezsurf
!!! Then life is nice.
clc;clear all; close all;
pmin=-.25*pi;
pmax=1.25*pi;
%---Surface---%
figure(1)
colormap([.65 .65 .65])
hold on
[x,t]=meshgrid(-.75:0.01:1,pmin:.1:pmax);
surf((x-2).*cos(t),(x-2).*sin(t),x)
surf((x-2).*cos(t),(x-2).*sin(t),-x)
[x,t]=meshgrid(-1:0.01:1,pmin:.1:pmax);
surf((-sqrt(1-x.^2)-3.41).*cos(t),(-sqrt(1-x.^2)-3.41).*sin(t),x)
[x,t]=meshgrid(.75:0.01:1,pmin:.1:pmax);
surf((sqrt(1-x.^2)-3.41).*cos(t),(sqrt(1-x.^2)-3.41).*sin(t),x)
[x,t]=meshgrid(-1:0.01:-.75,pmin:.1:pmax);
surf((sqrt(1-x.^2)-3.41).*cos(t),(sqrt(1-x.^2)-3.41).*sin(t),x)
shading interp
view(185,10)
axis equal
h=light('Position',[0 10 0])
%---------------------%
%-- Wireframe---%
[x,t]=meshgrid(-.75:0.25:1,pmin:.1:pmax);
mesh((x-2).*cos(t),(x-2).*sin(t),x,'Edgecolor','k','FaceColor','none')
mesh((x-2).*cos(t),(x-2).*sin(t),-x,'Edgecolor','k','FaceColor','none')
[x,t]=meshgrid(-1:0.1:1,pmin:.1:pmax);
mesh((-sqrt(1-x.^2)-3.41).*cos(t),(-sqrt(1-x.^2)-3.41).*sin(t),x,'Edgecolor','k','FaceColor','none')
[x,t]=meshgrid(.75:0.05:1,pmin:.1:pmax);
mesh((sqrt(1-x.^2)-3.41).*cos(t),(sqrt(1-x.^2)-3.41).*sin(t),x,'Edgecolor','k','FaceColor','none')
[x,t]=meshgrid(-1:0.05:-.75,pmin:.1:pmax);
mesh((sqrt(1-x.^2)-3.41).*cos(t),(sqrt(1-x.^2)-3.41).*sin(t),x,'Edgecolor','k','FaceColor','none')
%---------------%