This file contains editable Matlab code for general GP algorithms for rotation. See "http://www.stat.ucla.edu/research" for a discussion of these. ------------------------------------------------------------ The general GP algorithm for orthogonal rotation. ------------------------------------------------------------ function [Th,table]=GPorth(T) al=1; table=[]; for iter=0:500 [f,G]=vgf(T); M=T'*G; S=(M+M')/2; Gp=G-T*S; s=norm(Gp,'fro'); table=[table;iter f log10(s) al]; if s<10^(-5),break,end al=2*al; for i=0:10 X=T-al*Gp; [U,D,V]=svd(X,0); Tt=U*V'; [ft,Gt]=vgf(Tt); if ft