% -----------------------------------------------------
% plotting3d_helix.m
% -----------------------------------------------------
% Write a program that computes and plots a helix in 3D. 
% -----------------------------------------------------
% Copyright and license details available at matlabmarina.com
%------------------------------------------------------

clear;
clc;
close all;

% define t (the parameter)
t = 0.0 : 0.1 : 10*pi;

% compute x, y and z
x = sin(t);
y = cos(t) .* sin(t);
z = t;

% plot the helix
figure(1)
plot3(x,y,z,'r');
xlabel('x = sin(t)');
ylabel('y = cos(t)');
zlabel('z = t');
title('A helix function');
grid;
