


evec_stack = reshape(evecs,height,width,frames);

%Movie Info
figure;

subplot(5,4,1);
axis off
text(0.05,0.45,'SV 1:  ')
text(0.5,0.45,num2str(evals(1),'%10.2e'))

%Eigenvalues 
%Plotted eigenvalues are from 2 to 10
subplot(5,4,2:3)
semilogy(evals(2:10));
xlim([2 10]);
title('Singular Values 2->n');

pic=evec_stack(:,:,1);
%Eigenvector 1
subplot(5,4,5);
colormap(gray);
imagesc(pic,[min(min(pic)) max(max(pic))]);
axis image; axis off;
title('Spatial Mode 1');

%Coefficient 1
subplot(5,4,6:7);
plot(coeffs(:,1));
title('Coefficient 1');

subplot(5,4,8);
hist(coeffs(:,1),100);


%Eigenvector 2
pic=evec_stack(:,:,2);
subplot(5,4,9);
imagesc(pic,[min(min(pic)) max(max(pic))]);
axis image; axis off;
title('Spatial Mode 2');

%Coefficient 2
subplot(5,4,10:11);
plot(coeffs(:,2));
title('Coefficient 2');

subplot(5,4,12);
hist(coeffs(:,2),100);


%Eigenvector 3
subplot(5,4,13);
imagesc(evec_stack(:,:,3));
axis image; axis off;
title('Spatial Mode 3');

%Coefficient 3
subplot(5,4,14:15);
plot(coeffs(:,3));
title('Coefficient 3');

subplot(5,4,16);
hist(coeffs(:,3),100);


%Eigenvector 4
subplot(5,4,17);
imagesc(evec_stack(:,:,4));
axis image; axis off;
title('Spatial Mode 4');

%Coefficient 4
subplot(5,4,18:19);
plot(coeffs(:,4));
title('Coefficient 4');

subplot(5,4,20);
hist(coeffs(:,4),100);


clear pic evec_stack cvar
