Why can't I use the PCA function on my 513*40 matirx with positive and negative values?

2 views (last 30 days)
I have a 513*40 matrix of EEG data so that means microvolt values ranging from -30 to 30. I want to use the function PCA in order to reduce the dimensionality so I can use a pattern recognition software but when I say coeff=pca(x) it gives me the error message that subscript must be positive real integers or logicals. I have tried taking the RMS of the matrix to make all positive but I still get the same error. Can anyone explain why?
anxious for reply. Thanks Kim

Accepted Answer

Image Analyst
Image Analyst on 15 Jun 2014
You have an array in your program called pca. This causes it to take precedence over the toolbox function. So it's assuming x are indexes of your array called pca instead of inputs to the function pca. Rename your pca array to something else, like pcaCoefficients or something.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!