function [prcomp]=getpca(obsdata)
	% does some simple principal component analysis
	disp('pca')
% bottleneck start
	temp1=cov(obsdata); % 0.2s
%tic
	%
%	temp2=diag(cellfun(@svd,num2cell(temp1)));% 52 seconds



	%parcellfun even slower
	temp2=svd(temp1); % 30.25 s
%disp('bottleneck')
toc
	temp3=sum(temp2); % <1ms
	pca=temp2./temp3; %<1ms
%	pca=svd(cov(obsdata))./sum(svd(cov(obsdata)));
%bottleneck stop
	tmp_pca=size(pca)%another ugly hack forced by matlab

	pcb=[0 (pca(2:tmp_pca(1))./sum(pca(2:tmp_pca(1))))']';
	
	tmp_pcb=size(pca);%another ugly hack forced by matlab
	
	disp('Number of components, variance and cumulative variance, and ignore first PC')
	prcomp=[(1:min(10,tmp_pca(1)) )' pca(1:min(10,tmp_pca(1))) cumsum(pca(1:min(10,tmp_pca(1)))) cumsum(pcb(1:min(10,tmp_pcb(1)))) ]
 % variance in PC and cumulative variance
end
