fixed column vs row vector K.q in mex file.