% -----------------------------------------------------
% plotting_sinecurve.m
% -----------------------------------------------------
% Write a program that computes and plots the sine function
% from 0 to 4pi. 
% -----------------------------------------------------
% Notes: None. 
% -----------------------------------------------------
% Copyright and license details available at matlabmarina.com
%------------------------------------------------------

clear;
clc;
close all;

% define x
x = 0.0 : 0.1 : 4*pi;

% compute y
y = sin(x);

% plot x vs y
figure(1)
plot(x,y);
xlabel('elements in vector x from 0 to 4\pi');
ylabel('elements in vector y = sin(x)');
title('The sine function from 0 to 4\pi');
grid;

% Note that the \ before the pi in above strings
% ensures the use of the symbol pi. 
