Question: Here is some code, followed by the figure: fnames = {'France' , 'Japan' , 'Greece' , 'UK' , 'USA' }; N = [1 2 3

Here is some code, followed by the figure: fnames
Here is some code, followed by the figure: fnames = {'France' , 'Japan' , 'Greece' , 'UK' , 'USA' }; N = [1 2 3 5 10] ; h = figure (1) ; set (h, 'units' , 'normalized' , 'outerposition' , [0 0 1 1]); %expands figure to full screen for j = 1:5 fname = sprintf ('flags/flag%d. png' , j) ; X = imread (fname) ; X = double (X); %%convert from uinto to double precision float figure (1) ; subplot (5,6, (j-1)*6 + 1); imagesc(X, [0 255]); axis image; colormap gray; set (gca, 'XTick' , , 'YTick' , , 'FontWeight', 'bold' ); ylabel (fnames{j}) ; %%put your SVD code here] [u, s, v] = svd (X) ; for k = 1:5 n = N(k) ; X = u(: , 1 :n)*s(1 :n, 1:n)*v(: , 1:n)' ; subplot (5,6, (j-1)*6+(k+1)) ; imagesc (X, [0 255] ); axis image; colormap gray; set (gca, 'XTick' , , ' YTick' , , ' FontWeight', 'bold') ; if (j = = 1) title (sprintf ('N = %d' , n) ) ; end end ss = diag(s) ; figure (2) ; semilogy (1 : 400, ss (1: 400) , 'LineWidth' , 2) ; hold on; end figure(2); hold off; legend (fnames)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!