(parfor, Matlab Coder friendly) Matlab implementation of JointBoost