sampling a continuous time signal using MATLAB?
This information can be found other places as well but I will step through it here using MATLAB.

You say your sampling rate is $100$ Hz and the signal is $10$ Hz. Lets define those along with the sampling period ($1/100$ seconds).

sampleRate = 100;
samplePeriod = 1/sampleRate;
signalFreq = 10;


Now you want $2$ seconds of this, so define your sampled time vector.

nT = 0:samplePeriod:2;


Now we create the signal, and plot the result.

signal = cos(2*pi*signalFreq*nT);

figure
stem(nT, signal)
grid on
xlabel('Time (sec)')
ylabel('Amplitude')


If you only want to plot $0 \leq n \leq 19$, then you may instead set nT = [0:19]*samplePeriod;.