LCE Matlab implementation