function [u_M,L] = fcn(i1,LX_pos,Index)

%%%%----Einlesen der Matrizen-----%%%%

u_M=Index(1:8,:);       %%---Matrix für 1A
o_M=Index(9:16,:);      %%---Matrix für 2A


 %%---zwischen diesen beiden Strömen wird interpoliert, daher wird der
 %%---aktuelle Stromwert auf- und abgerundet
uG=(floor(i1));        
oG=(ceil(i1));

%%%%%%%%-----------Interpolation der Induktivitätsmatrix-----------%%%%%%%%

i_uG=uG;
i_oG=oG;

L=zeros(8,8);

for a=1:1:8
    for b=1:1:8
       %%%%%------Interpolation der neuen Induktivitätsmatrix------%%%%%      
        y=u_M(a,b)+((i1-i_uG)/(i_oG-i_uG))*(o_M(a,b)-u_M(a,b));  %lineare Interpolation
        L(a,b)=abs(y-LX_pos*10^3);        %--neue Induktivitätsmatrix, wird subtraiert mit aktuell gemessener Induktivität
        
        %%%%%------finden des jeweils benachbarten Induktivitätswertes  ------%%%%%
        
    end
end
       
          %%%%---Auswertung der Position in der Matrix
          [C,rowminarray]=min(L);
          [~,colmin]=min(C);
          rowmin=rowminarray(colmin);
          
          %%%%%%%%----Positionsausgabe----%%%%%%
          
          xr=-0.5+0.1*colmin;
          yr=-0.5+0.1*rowmin;     