% mods1 --- Initialization
A = H;
[q1, sval, p] = svd(A);
s1 = diag(sval);
if all(s1)       % If s1(i) ~= 0 for all i, then put r = length(s1)
  r = length(s1);
else
  r = find(s1 == 0);
end
fprintf('Rank(A) = %g\n',r)
s = s1(1:r);
fprintf('The positive singular values are:\n')
vprint(s);
r = input('New value for r = ');
s = s1(1:r);
q = q1(:,1:r);
s2 = s.^2;
load 'yvec.dat'
y = yvec;
vv = s.*(q'*y);
fprintf('\nNow do mods3.\n')
