function  [eyepos]=eye_pos__input_V4(Nmsc,hor)

%    This function calculates the activity values of the  Eye-position format which are presented in a forward
%    direction to the hidden layer
% 
% 	  function that generates motoneuron activation profile:
% 	      F = alfa * (Eye position - Threshold)
% 	  Furthermore: alfa depends on threshold according to:
% 	   alfa = 0.1 * Threshold + 9.0 (instead of 7.6)
% 	     (see Van Gisbergen and Van Opstal, Chapter III: Models, Fig. 1)
if nargin < 2
  hor = 0;
end
if nargin < 1
  Nmsc = 30;
end

global Gain_ocul; 
global Gain_pos;

Gain_ocul = 1/400;
Gain_pos = 7/10;

eyepos=zeros(2,Nmsc);

	for j=1:1:Nmsc
		
		thresh = -50 + (80 * ( j - 1) / (Nmsc - 1) );
		
		%/* NEGATIVE SLOPE Horizontal MOTONEURONS */
		slope  = -Gain_ocul * (90 - thresh) / 10  ;
		
			if  (hor  <= thresh) rate = slope * (hor - thresh);
				else rate = 0;
			end
			
			eyepos(1,j) = rate * Gain_pos;
					
		%/* POSITIVE SLOPE Horizontal MOTONEURONS */
		slope  = +Gain_ocul * (90 + thresh) / 10;
		
			if  (hor - thresh >= 0) rate = slope * (hor - thresh);
				else rate = 0;
			end;
			
			eyepos(2,j)= rate * Gain_pos;
			
	end	
	
end
%/* *************** END  EYE_POS OUTPUT *************** */