<cmath> must be explicitly included for mex (matlab compiler script) to recognise std::pow.