Quaternion or octonion conjugate.
(Quaternion and octonion overloadings of standard MATLAB® function)
Y = conj(X, S)
This function implements three different conjugates: conj(X) with the second parameter omitted, returns the standard quaternion or Hamilton conjugate, that is for a quaternion q = w + ix + jy + kz it returns q = w - ix - jy - kz. The same result is obtained if the parameter S is supplied with the value 'hamilton'.
If the second parameter has the value 'complex', the result is the complex conjugate, that is the quaternion in which all four components w, x, y and z have been replaced by their complex conjugates. Obviously this has no effect if the quaternion is real.
Finally, if the second parameter has the value 'total', the result is equivalent to conj(conj(X, 'complex'), 'hamilton'), that is both conjugates are applied.
>> conj(quaternion(1,2,3,4)) ans = 1 - 2 * I - 3 * J - 4 * K