finding period with autocorrelation is not correct
Actually, implementing my suggestion in the comment leads to a better solution:

N_period = 1000;
start_time = 0;
end_time = 1;
dt = (end_time-start_time)/N_period; 
fs = 1/dt; %sample frequency
t = start_time:dt:end_time-dt;
y_period = sin(2*pi*t);

y = [y_period(0.7*N_period:N_period), y_period];

[autocor, lags] = xcorr(y);
figure(1);
plot(lags, autocor ./ (100+length(y) - abs(lags)))
grid




I only calculate the autocorrelation of y without the zero-padding (y_cor) (actually, it does not really matter). As you see, if you divide the autocorrelation by the number of overlapped samples, you get a better result. However, it is not perfect, I've added an (arbitrary) constant 100 to the division to account for boundary effects.