Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Feature Extraction for EMG data using PCA
Date: Wed, 4 Mar 2009 10:53:01 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 28
Message-ID: <golmid$8sp$1@fred.mathworks.com>
References: <goh104$17e$1@fred.mathworks.com> <6a1f9244-51d8-4e3b-9fb8-2aefcab53109@y33g2000prg.googlegroups.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1236163981 9113 172.30.248.35 (4 Mar 2009 10:53:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 4 Mar 2009 10:53:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1736490
Xref: news.mathworks.com comp.soft-sys.matlab:522377


"russell.fung@gmail.com" <russell.fung@gmail.com> wrote in message <6a1f9244-51d8-4e3b-9fb8-2aefcab53109@y33g2000prg.googlegroups.com>...
> On Mar 2, 10:20=A0am, "anoop " <nomail...@rediffmail.com> wrote:
> > I have a EMG data matrix of size 90(subjects) x 4800(variables). I want t=
> o apply PCA to reduce the no. of variables, e.g ( i want matrix of size 90 =
> x 1200 after PCA).
> > I need a matlab program to do so. suggestions are welcome!!
> 
> You can write a program to do PCA using subroutines included in basic
> Matlab without any extra toolboxes.
> 
> You need to find the eigenvectors and eigenvalues of the covariance
> matrix of your data, from which you find the most significant
> principal components, then you expand your data along the principal
> directions.

well i wrote the program as given below:
max_PCs=1200;
covariance_matrix=cov(data);
[eigvect,eigval]=eig(covariance_matrix);
eigval=diag(eigval);
[junk,rindices]=sort(-1*eigval);
eigen_values=eigval(rindices);
arranged_eigen_vectors=eigvect(:,rindices);
eigen_values_extacted=eigen_values(1:max_PCs);
principle_components=arranged_eigen_vectors(:,1:max_PCs);
projected_data=xpca*principle_components;

but it takes very long time to execute. could you please give me faster matlab code?? what should i use for training the neural network (projected data or principal components) ??