So, im trying to write a script to plot x=x1 + tV1cos(theta). The figure will generate but no points. What can I do to fix this? Any help would be extremely appreciated. Thank you in advance
%% Get user input
launch_angle= input('Enter launch angle in degrees : ');
xo = input('Enter initial x position in meters: ');
xt = input('Enter target x position in meters: ');
yt = input('Enter target y position in meters: ');
tt = input('Enter target hitting time in seconds: ');
te = input('Enter end time in seconds: ');
g=9.8;
% Calculate Vo
vo = (xt-xo)/(tt*(cos(launch_angle * (pi/180))))
%% Display the result
disp(['Initial Velocity in metres per second is: ', num2str(vo)]);
%% Calculate yo
yo = yt – (tt*vo*(sin(launch_angle * (pi/180))))+(0.5*g*tt^2)
%% Display the result
disp(['Initial y positon in metres is: ', num2str(yo)]);
%% Equations to plot End pt
xe = xo + (te*vo*cos(launch_angle * (pi/180)))
ye = yo + (te*vo*(sin(launch_angle * (pi/180))))-(0.5*g*te^2)
%% Plot end point
figure
plot(xe',ye','-r');
Best Answer