added some matlab functions similar to R ess functionality