%%%%%%%%%%%%%%
function out1=MultiSMD (x, K, sumabsu, sumabsv, v, niter, varvigin)
if nargin<6
niter=20;  
end  
  nas=isnan(x);
  vinit = v;
  xuse = x;
  ds = zeros(1,K);
  us= zeros(size(x,1),K);
  vs = zeros(size(x,2),K);
  for k =1:K
    v0=v(:,k);
    out = SMD(xuse, sumabsu, sumabsv, v0, niter);
    us(:,k) =out.u; 
    vs(:,k) = out.v ;
    ds(k) = out.d;
    res = xuse - out.d*out.u*(out.v)'; 
    xuse(~nas)= res(~nas);
  end
  
 out1.u=us;
 out1.v=vs;
 out1.d=ds;
 out1.vinit=vinit;