I found solution by myself.
Here is the code without loop.
X=readtable('rt_v1.txt');
R(:,1)=X{:,1}/100;%radius (m)
R(:,2)=X{:,4}*0.0001; %magnetic field (Tesla)
A=sortrows(R,1); %sorting according to R value
[r,c] = size(A);
nlay = 42; % layer size
Avg = transpose(squeeze(mean(permute(reshape(A',[c,r/nlay,nlay]),[2,1,3]),1)))