function search_c(X,actual_dimension)

global real_class_position class_position sigma dimension number class_index max_class


d=actual_dimension;
 for k=1:length(find(class_position(d,:))) 
      tmp_X=zeros(dimension,max_class*number); 
                index_counter=1;
                for j=1:length(find(X(d,:))>0) 
                    if abs(X(d,j)-class_position(d,k))<sigma(d,k)
                       for l=1:dimension
                           tmp_X(l,index_counter)=X(l,j);
                       end;    
                       index_counter=index_counter+1; 
                   end; 
               end;
               index_counter;
               if d==dimension 
                if index_counter>1
                   for l=1:dimension 
                       sum=0;
                       index_counter=1;
                       for j=1:length(find(tmp_X(l,:))>0) 
                           sum=sum+tmp_X(l,j);
                           index_counter=index_counter+1;
                       end;
                       if index_counter>1
                          real_class_position(l,class_index)=sum/(index_counter-1); 
                       end;   
                   end;    
                   if index_counter>1
                           class_index=class_index+1;
                   end;        
                end;   
             else 
             search_c(tmp_X,d+1);
             end; 
       end; 
             
                    













