%QUARTIMIN 
function [T, ft] = Qmin(B1,B2)


[N,r] = size(B1);
[K,r] = size(B2);

f=0;fold=100000;

for i=1:50,
    T = orth(rand(r,r) - .5);
    [T,f,table]=GPQmin(B1,B2,T);
    if f<fold,
         fold =f;
         Told = T;
         tableold=table;
     end;
%[f fold]
end;
T =Told;
ft=fold;
