function [ fh ] = screePlot( eigvals ) % % Plots a scree plot of the variances of the principle components. % Taken from page 38 of % % Exploratory Data Analysis with MATLAB % by Martinez and Martinez. % % Written by: % -- % John L. Weatherwax 2005-08-14 % % email: wax@alum.mit.edu % % Please send comments and especially bug reports to the % above email address. % %----- % make sure we have a row vector (with postive values): eigvals = abs(eigvals(:).'); % Sort eigenvalues in decreasing order: [ eigvals ] = sort( eigvals ); eigvals = fliplr( eigvals ); fh=figure; %subplot(1,2,1); plot( eigvals, '-ok' ); %plot( log(eigvals), '-ok' ); axis tight; grid on; xlabel( 'Eigenvalue Index - k' ); ylabel( 'Eigenvalue Magnitude' ); title( 'scree plot' ); %subplot(1,2,2); %plot( log(eigvals), '-ok' ); axis tight;