[U,S,V] = svd(D); A = S*V'; % D=U*A range(D-U*A) K = 1:5; [Ur,R]=varimax_kaplan(U(:,K)); % Ur = U*R; range(Ur-U(:,K)*R) % U(:,K)*R*inv(R)*A(K,:) Ar = inv(R)*A(K,:); % The Ur remain orthogonal, but the Ar do not m = 1; subplot(221) pcolorjw(lon,lat,reshape(U(:,1),[nlats nlons]));colorbar; subplot(222) pcolorjw(lon,lat,reshape(Ur(:,1),[nlats nlons]));colorbar; subplot(223) plot(year,A(m,:)) subplot(224) plot(year,Ar(m,:)) ff diag(A*A') = diag(S*S')