MATLAB: How to plot these two graphs with the array/set of inputs

matlab trajectories help

Hello.
I'm trying to plot 5 trajectories corresponding to Theta = 0.4, 0.6, pi/4, 1.0, 1.2
Where the given functions are
Vx=V*Cos(theta)
Vy=V*Sin(theta)-9.8
Here is my Mfile, don't think I'm right.
%Question 1 - plotting five trajectories corresponding to
% Theta = 0.4, 0.6, pi/4, 1.0, 1.2
clc;clear;
x = 0.001:6*pi
V = 120
theta = ([0.4 0.6 pi/4 1.0 1.2])
steps=size(x,2);
Vo = 0:0.01:6*pi;
Vx = V*Cos(theta)
Vy = V*Sin(theta) - 9.8
% Graph of Vx*Cos(theta)
plot(Vo,Vx,'-b','Linewidth',2)
grid on
hold on
% Graph of Vo*Sin(theta) - 9.8
plot(Vo,Vy,'-r','Linewidth',2)
hold off
Thanks for the help

Best Answer

%Question 1 - plotting five trajectories corresponding to
% Theta = 0.4, 0.6, pi/4, 1.0, 1.2
clc;
clear;
V = 120
theta = ([0.4 0.6 pi/4 1.0 1.2])
Vo = 0:0.01:6*pi;
Vx = V*cos(bsxfun(@times,Vo',theta))
Vy = V*sin(bsxfun(@times,Vo',theta)) - 9.8
% Graph of Vx*cos(theta)
plot(Vo,Vx,'-b','Linewidth',2)
grid on
hold on
% Graph of Vo*sin(theta) - 9.8
plot(Vo,Vy,'-r','Linewidth',2)
hold off