It seems that you have 418 cases, divided into a training set of 318 cases and a test set of 100 cases. I'll answer your question and suggest a closely related but potentially better approach to your problem.
As noted on the MATLAB help page, for PCR it's best if the predictors are both centered and scaled to unit variance so that differences in scales don't unduly weight the results. They didn't do that in their example, but if your predictors are on different scales then you might consider scaling in addition to centering.
The code you adapted from that page apparently returns the regression to the original scales of both $x$ and $y$, according to how the plot on that page was obtained (although my memory of MATLAB syntax is too rusty to verify that directly). Replacing the $X$ in the last line of code with your matrix of test data should give you the predicted $y$ values for those test data. To verify, try using a small sample of your original data for $X$ and see if the predictions make sense.
But PCR with a training set and a separate test set might not be the best approach to your problem. PCR picks the principal components that capture the most variance in the predictor variables, but not necessarily those most related to the response variable. The partial least squares approach illustrated on the same help page can be better related to outcomes. Also, the separation into training and test sets, if that's what you've done, doesn't efficiently use all the information in your data.
Ridge regression, provided by the
ridge function in MATLAB, is essentially PCR but with different weights placed on the components instead of the all-or-none selection in PCR. Large regression coefficients that don't help much with predicting outcomes are penalized. This helps bring the coefficients better in line with relations to the outcome variable and helps correct for overfitting. You can start with all of your data to set up the model (if my understanding of what you've done is correct), then use cross validation or bootstrapping to choose the penalty that minimizes prediction error.