Studying spectral leakage due to DFT length and frequency resolution
It looks like what you are doing is only changing the DFT size (using N1 variable), this is equivalent to padding your signals with zeros up to a given length. Your signal (for N1=200) looks like:



It can be immediately seen that the periodic extension is not really a continuous waveform. This discontinuity is introducing the leakage effect that you are observing.

Below a quick and dirty code that demonstrates that. I did both padding of input signal in time domain, as well as calling the fft function with twice the signal size. Plots are in dB scale.



F0=10; %Frequency of the sinusoid
Fs=100; %Sampling Frequency
observationTime = 1; %observation time in seconds
t=0:1/Fs:observationTime-1/Fs; %time base

%% Ideal case
x=sin(2*pi*F0*t);%sampled sine wave

N1=100; %DFT length same as signal length
X1 = abs(1/N1*fftshift(fft(x,N1)));%N-point complex DFT of x
f1=(-N1/2:1:N1/2-1)*Fs/N1; %frequencies on x-axis
X1 = 10*log10(X1/max(X1));
subplot(2,1,1)
plot(f1,X1, 'o-');
title('Ideal case')
grid on

%% Padding signal with zeros
x2 = [x zeros(1, length(x))];

N2=200; %DFT length same as signal length
X2 = abs(1/N2*fftshift(fft(x, N2)));%N-point complex DFT of x
f2=(-N2/2:1:N2/2-1)*Fs/N2; %frequencies on x-axis
X2 = 10*log10(X2/max(X2));
subplot(2,1,2)
plot(f2,X2, 'o-');
hold on
grid on

%% Padding with zeros implicitly
N2=200; %DFT length same as signal length
X3 = abs(1/N2*fftshift(fft(x, N2)));%N-point complex DFT of x
f3=(-N2/2:1:N2/2-1)*Fs/N2; %frequencies on x-axis
X3 = 10*log10(X3/max(X3));
plot(f3,X3, 'r-');
title('Padding with zeros')
legend({'Padded vector', 'Twice the FFT size'})