function [Ynew_hat,B,C,R,zz,zz2]= My_pls(Xcal,Ycal,Xnew,method,LV)

[n,px]=size(Xcal);   					           
[n,m]=size(Ycal); 

if method==0 % Mean-center	
	[Xce,mX,Xnew_ce]=centrar(Xcal,1,Xnew);		
	[Yce,mY]=centrar(Ycal,1);    
    % Standartization of the model
	[B,C,P,T,U,R,zz,zz2]=simpls(Xce,Yce,LV,Xce'*Yce,[]);
	Ynew_hat=Xnew_ce*B;		
	[Ynew_hat]=centrar_inverso(Ynew_hat,mY);
end

% if method==1	% Autoscale
% 	[Xauto,mX,sX,Xnew_auto]=scale(Xcal,1,Xnew);
% 	[Yce,mY]=centrar(Ycal,1);				
% 	[B]=simpls2(Xauto,Yce,LV,Xauto'*Yce,[]);	
% 	Ynew_hat=Xnew_auto*B;				
% 	[Ynew_hat]=centrar_inverso(Ynew_hat,mY);
% end

end