You can use pca() if you have the Statistics and Machine Learning Toolbox. Did you try it? Basically you put your data in as a matrix with each of the 22 variables being a column, and your observations/measurements being the rows. For example row 9 has all the 22 measurements for sample/observation/test set #9, and so on. Then you'll get 22 PCs where each row of output has the PC weights for those 22 PCs. There are fancy ways, like Eigenvector's PLS toolbox where you can examine the data to try to figure out which of those 22 PC are the most relevant (strongest).
I've attached a PCA example where I used PCA to find the PCs of a collection of separate values (x, y, and z locations):
along with another, different example where I take the PCs of an RGB image: