- Data Preprocessing: Ensure that your data matrix X is correctly formatted as n-by-p.
- Function Call: Verify that you are calling the pca function correctly and not using any additional arguments that might alter the output.
Doubt regarding the dimension of coeff in pca function
1 次查看(过去 30 天)
显示 更早的评论
Under the description of the function 'pca', it is given that the coeff=pca(X) returns a coeff matrix of p by p matrix if the data matrix X is n by p.
*[coeff = pca(X) returns the principal component coefficients, also known as loadings, for the n-by-p data matrix X. Rows of X correspond to observations and columns correspond to variables. The coefficient matrix is p-by-p.]
However, when I checked with my data I'm getting the coeff dimension as same as data matrix. I also checked by assigning the data matrix using **random numbers. The coeff values will values be p by p ? Could anyone please explain?
========== *Taken from Matlan Tutorial **Obtained by using rand function in Matlab ==========
0 个评论
回答(1 个)
arushi
2024-7-30
Hi Shehz,
If you are seeing different dimensions, consider examining the follwoing potential issues:
Hope this helps.
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!