Basically, twap_wmfix, but for Matlab.