MATLAB: Fsurf with symbolic variables

fsurfsymbolic toolbox

I'm trying to plot the eigenvalues of a symbolic 3×3 matrix using the code below:
syms kx ky phi;
assume(kx,'real'); assume(ky, 'real'); assume(phi,'real');
cx = (1+exp(-1i*kx));
cy = (1+exp(-1i*ky));
H0 = [0 cx cy; conj(cx) 0 0; conj(cy) 0 0];
eig0 = eig(H0);
for ie = 1:3
fsurf(eig0(ie),[0,2*pi,0,2*pi],'edgecolor','none'); hold on;
end
hold off
xlabel('k_x/a'); ylabel('k_y/a');
As you can see the resulting plot is terrible,as there are holes everywhere. If I use ezsurf instead it is working fine.
Is it a bug of fsurf or am I missing something?

Best Answer

The MATLAB plot functions do not plot imaginary numbers.
Try this:
hold on
for ie = 1:3
fsurf(real(eig0(ie)),[0,2*pi,0,2*pi],'edgecolor','none')
fsurf(imag(eig0(ie)),[0,2*pi,0,2*pi],'edgecolor','none')
end
hold off
view(-30,30)
xlabel('k\_x/a'); ylabel('k\_y/a')
Experiment to get different results.
.