- You've already done this with [u, s, v] = svd(group1).
- u contains the left singular vectors (principal directions) for group1.
- s contains the singular values.
- v contains the right singular vectors.
- Since you mentioned that one principal component explains most of the variance, you will focus on the first column of u (i.e., u(:, 1)).
- To project group2 onto the principal component space of group1, use the first singular vector (u(:, 1)) as the basis for projection.
- Multiply group2 by the principal component direction to obtain the projection scores.
- The group2Projection vector contains the projection scores of group2 onto the first principal component of group1.
- You can compare these scores with the projection scores of group1 to see if the first principal component separates the two groups.
- Plot the projection scores to visualize the separation: