Options = struct('convcrit',struct('fit',10 * eps,...
     'grad',1e-9,...
     'maxiter',2500,...
     'par',1e-8,...
     'relfit',1e-6),...
     'diagnostics','on',...
     'display',1,...
     'initialisation',struct('maxiter',5,...
     'method','random',...
     'tol',1e-5),...
     'lambdaudpar',[2,1/3],...
     'lambdaini',1e-1,...
     'weights',[]);

[Factors,Diagnostics] = indafac(NmrData,3,[],Options);
% 
SeparatedPARAFACplots(Factors)

% Matrix = doNanValues(NmrData,70);
% 
% [Factors,Diagnostics] = indafac(Matrix,3,[],Options);

% temp=flipud(fftshift(NmrData,1));
% temp2=(ifft(temp));
% [Factors,Diagnostics] = indafac(temp2,3,[],Options);
% 
% a = flipud((fftshift(fft(Factors{1},3552),1)));


