You can get the position/index of the maximum element from array using max itself. You need not to find the index later.
a = load('ra1.dat');
x = a(:,1);
y = a(:,2);
y_mov_average = filter(ones(1,50)/50,1,y);
plot(x,y);
hold on
dy = diff(y)./diff(x);
dy_mov_average = filter(ones(1,10)/10,1,dy);
plot(x(2:end),dy_mov_average);
PEAKSID = findpeaks(dy_mov_average);
ID = class(PEAKSID);
[PEAKIDCAL,VALUE] = (max(PEAKSID));
xaty = x(VALUE);
Best Answer