To orthogonalize a matrix with respect to a vector(?) I'm developing a code to perform Mie scattering corrections and, while reading a paper regarding this [1], I found this sentence:

Prior to approximation by PCA, the matrix $M$ is orthogonalized with
  respect to the reference spectrum $Z_{ref}$

where $Z_{ref}$ is a vector of data.
The matrix $M$ has a spectrum of data in every row, so I thought that perhaps they mean to orthogonalize each row of $M$ with respect to $Z_{ref}$, because an orthogonal matrix is a square matrix $Q$ such that $Q^T = Q^{-1}$, and this does not depend on any vector. 
Even if they refer to this, I don't know what would be to orthogonalize a vector with respect to another neither (of course I know what are two orthogonal vectors but not sure about what they mean orthogonalize). Any thoughts?
Sorry if this question does not fit here.



*

*Konevskikh, Tatiana, et al. "Mie scatter corrections in single cell infrared microspectroscopy." Faraday discussions 187 (2016): 235-257.

 A: I have found the solution. It's similar to the answer of @Daddyo but with some additional things.
I just have to take each row $Q$ of the matrix $M$ as a vector and calculate its projection in the plane normal to the vector $Z_{ref}$. This is done with the following expression, where $Q^*$ is the orthogonalized row.
$$Q^* = Q - \dfrac{Q \cdot Z_{ref}}{\| Z_{ref} \|^2} Z_{ref}$$
If you compute the scalar product between $Q^*$ and $Z_{ref}$ you see that they are orthogonal to each other.
$$Q^* \cdot Z_{ref} = Q \cdot Z_{ref} - \dfrac{Q \cdot Z_{ref}}{\| Z_{ref} \|^2} (Z_{ref} \cdot Z_{ref}) = Q \cdot Z_{ref} - Q \cdot Z_{ref} = 0$$
A: It sounds as if they want to detect dominant trends in the data that are not similar to Zref.  You can do that by removing any trace of $Z_{ref}$ from each of your spectrums.
You can make row 1, call it $M_1$, orthogonal to $Z_{ref}$ by subtracting $Z_{ref}$, scaled by the dot product of $M_1$ and $Z_{ref}$, from $M_1$.  So your new orthogonalized row , call it $M_1^*$, would be $M_1^* = M_1 - (M_1 \cdot Z_{ref}) Z_{ref}$.  The new row, $M_1^*$, is orthogonal to $Z_{ref}$.
If you repeat that for every row, then each of your spectra will be cleansed of components of $Z_{ref}$ in them.
