Watch this Author's files
Thanks for the correction of the TE mode, everything works fine now !
Really nice and well written script. Ready to study the EM scattering of 2D structures.
However, I think there is a problem in the TE mode. I simulated a cylinder (just removed "&& (L(1)-I*dx<=J*dy", line 63) and observed that the Hz pattern isn't quite symmetric...