function ok = GetErrorPlot(imageC, u) % ok = GetErrorPlot(imageIndex, u) % This function Draws an error plot for a given image % Author : Sasakthi Abeysinghe, Timothy Simpson % Date : 04/05/2006 global imageWidth; global imageHeight; global x; global error; image0 = reshape(imageC, imageHeight,imageWidth, 3); error = double(size(u,2)); for i=1:size(u,2), error(i) = GetError(image0, ReconstructImage(imageC, u, i)); end plot([1:1:size(u,2)], error); title('Reconstruction error using Principle Components'); xlabel('Principle Components used'); ylabel('Error (Squared difference)'); set(findobj(gca,'Type','line','Color',[0 0 1]),'Color','red','LineWidth',2)