Question: need some help with my MatLab code please. . . The requirements for this project are: Use a for loop or a while loop to
need some help with my MatLab code please. . . The requirements for this project are:
Use a "for" loop or a "while" loop to propagate the projectile in 0.01 second time steps all the way until impact. Mark the impact spot with a marker and display the impact coordinates on the projectile/terrain plot. Label the axes accordingly and give your figure a title. While keeping the initial velocity constant, "experimentally" determine the initial angle of the projectile with respect to the horizontal in order to achieve maximum range.
I really need help with changes to my existing code that will stop the projectile at the intersection with the ground, and projecting the distance the projectile has travelled with each change of angle. My existing code is as follows:
syms x %giving the designation of x y=x*tand(50) -9.81*x^2/(2*200^2*cosd(50)^2); %the standard equation for trajectory z=.1*x; %the increase of the terrain s=vpa(solve(y==z,x),'6'); %equation for the two points where the two previous equations touch
%ploting fplot(z,[0,5722.86]) %attempted recommended but too many failures due to format %need to reseach other plotting styles hold on
fplot(y,[0,5722.86])
grid on title ('Plot of trajectory and terrain') legend('Terrain','Trajectory'); ylim ([0 1600]); %Needed to expand limits for better visual xlim ([0 5000])
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
