%PREAMBOLO

XXX=Pall;
RRR=R;
tsh=0.3;
XXX=Pall;
RRR=R;
dim=hor*tsh;
num_pall=1:1:dim;

%Number of "futures" for each starting point
S1=20;
%Length of each future
S2=20;
%Number of starting points
S3=20;

std_new=0.1;
new_s=2;

ext0=randsample(num_pall,S3,true);

FYUP=NaN(neq,S2,S3);
FYDW=NaN(neq,S2,S3);
FREUP=NaN(neq,S2,S3);
FREDW=NaN(neq,S2,S3);
h=waitbar(0,'Please Wait')



for ooo=1:S3
 ext=hor-dim+ext0(ooo);  
 randn('seed',1999)
 learning_sub3;
 
FYUP(:,:,ooo)=UP_25(:,:);
FYDW(:,:,ooo)=LOW_25(:,:);
FREUP(:,:,ooo)=UPRE_25(:,:);
FREDW(:,:,ooo)=LOWRE_25(:,:);


 waitbar(ooo/S3)
 
end