Hi Kim,
When performing PCA in MATLAB, you should expect the coeff matrix to contain as many columns as there are variables in your dataset. Each column in the coeff matrix represents a principal component, and each row corresponds to a variable. If you're seeing only one column of coefficients, it suggests that something might be off with the input data or the function call.
1) Check Data Dimensions:
- Ensure your data matrix data is structured correctly. It should be an ( n \times p ) matrix, where ( n ) is the number of observations (52 in your case) and ( p ) is the number of variables (50 in your case).
2) Standardize the Data:
- Although not strictly necessary for PCA, it's common to standardize the data so that each variable has zero mean and unit variance. This ensures that PCA does not give undue weight to variables with larger scales.
Here is a sample code for the same:
dataStandardized = (data - mean(data)) ./ std(data);
[coeff, score, latent] = pca(dataStandardized);