Matlab Implementation of Eletromagnetism-like Algorithm