%% Plot Multiple Lines Using Matrices
% Create matrix X containing three rows of x-coordinates. Create matrix Y containing three rows of y-coordinates.

t = 0:pi/500:pi;
X(1,:) = sin(t).*cos(10*t);
X(2,:) = sin(t).*cos(12*t);
X(3,:) = sin(t).*cos(20*t);

Y(1,:) = sin(t).*sin(10*t);
Y(2,:) = sin(t).*sin(12*t);
Y(3,:) = sin(t).*sin(20*t);

% Create matrix Z containing the z-coordinates for all three sets.

Z = cos(t);

% Plot all three sets of coordinates on the same set of axes.

plot3(X,Y,Z)

% Copyright 2018 The MathWorks, Inc.