%#5
f=0.6e3;
fsamp=8e3;
T=1/fsamp;
theta=30*pi/180;
time=[0:T/10:14e-3]';
amp=2;
xa=amp*sin(2*pi*f*time+theta);
subplot(2,1,1)
plot(time*1e3,xa,'r')
title('Lab1-Plot of #5');
xlabel('Time in msec');
ylabel('Amplitude');
grid on

tsamp=[0:T:14e-3]';
xb=amp*sin(2*pi*f*tsamp+theta);
n=tsamp/T;
subplot(2,1,2)
stem(n,xb,'b');
xlabel('Sample Index,n');
ylabel('Amplitude');
grid on

N=max(tsamp)/T
period=1/f
num_periods=max(time)/period

N =
   112
period =
    0.0017
num_periods =

    8.4000