MATLAB: How can i plot this sin wave as shown

plotsine wave

hello everyone and thanks in advance for help, i'm asked to plot this sin wave shown in the image below and i have to only get the first wave with the points on the graph. Now i have used this code in order to do so where i put
t = 0:pi/50:2;
s = sin(2*pi*t);
plot(t,s)
but when i get the plot i always get two waves and i must get only one with the specified points. help anyone and ty.

Best Answer

Very close, but the formula for a sine wave is Amplitude * sin(2*pi*x / period). If you do that, what do you get?
period = ??????; % You do this.
t = linspace(-1, 3, 500);
s = sin(2 * pi * t / period); % Now using the proper formula
plot(t,s, 'b-');
% Fancy up the graph, just for fun...
grid on;
% Plot Y axis
line([0,0], ylim, 'Color', 'k', 'LineWidth', 2);
% Plot x axis
line(xlim, [0,0], 'Color', 'k', 'LineWidth', 2);
yLabel('s', 'FontSize', 20);
xLabel('t', 'FontSize', 20);