MATLAB: Can’t I use the PCA function on the 513*40 matirx with positive and negative values

error logicals subscripts pca

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

Best Answer

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.