function [vm,sm] = prob_10_2(n) % PROB_10_2 - % % The largest eigenvalue of magic(n) will be sum(1:n^2)/n % The largest singular value will be this also. % % Written by: % -- % John L. Weatherwax 2005-08-28 % % email: wax@alum.mit.edu % % Please send comments and especially bug reports to the % above email address. % %----- v = eig(magic(n)); vm = max(v); s = svd(magic(n)); sm = max(s);