ported MVP to matlab