% Script ShowGangnam
close all
fName = 'Gangnam.jpg';
% Display the image...
figure
imshow(fName)
% Read in the image, convert to black-and-white, and then convert the 
% uint8 pixel values to double format...
A = double(rgb2gray(imread(fName)));
% Let's call A the "Gangnam Matrix"

% Compute the SVD of the Gangnam matrix and plot its singular values...
[U,S,V] = svd(A);
figure
semilogy(diag(S))
title('Singular values of the Gangnam Matrix','fontsize',14)
% Extract the "middle vertical third" of the Gangnam matrix...
[m,n] = size(A);
B = A(:,round(n/3):round(2*n/3));
% Convert this to a uint8 matrix and display...
figure
imshow(uint8(B))
