Question

MATLAB Write a user defined function for a projectile motion. If a ball is launched from...

MATLAB

Write a user defined function for a projectile motion. If a ball is launched from initial position(0,0) with a velocity v0 at angle θ, determine your horizontal and vertical position. Please plot x vs. t, y vs. t and y vs. x.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

theta_0 = 15:15:75;
t = 0:1/128:3;
g = 9.81;
V_0 = 5; % sets the initial velocity of the projectile


x_0_1 = V_0 .* cosd(theta_0);
y_0_1 = V_0 .* sind(theta_0);
x_0 = transpose(x_0_1);
y_0 = transpose(y_0_1);
x = x_0 * t;
time =[t;t;t;t;t];

y = y_0 *t - 0.5*g.*time.^2;
plot(x(1,:),y(1,:),'b')
hold on
plot(x(2,:),y(2,:),'r')
hold on
plot(x(3,:),y(3,:),'g')
hold on
plot(x(4,:),y(4,:),'Cyan')
hold on
plot(x(5,:),y(5,:),'Magenta')
xlabel('Horizontal distance, x, (m)')
ylabel('Height, y, (m)')
axis([0 3 0 max(y(5,:))])
legend('Initial angle=15°','Initial angle=30°','Initial angle=45°','Initial angle=60°','Initial angle=75°')%creates the legend of the graph


Figure 1 File Edit View Insert Tools Desktop Window Help Initial angle 15 Initial angle 30 Initial angle 45 Initial angle=60°

Add a comment
Know the answer?
Add Answer to:
MATLAB Write a user defined function for a projectile motion. If a ball is launched from...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • MATLAB, please provide code script Objective: Create a function file that animates projectile motion defined by...

    MATLAB, please provide code script Objective: Create a function file that animates projectile motion defined by the following equations in a subplot. Your function should accept user inputs of launch speed and launch angle. The output of your function will be a top subplot that displays height (y) as a function of x. The bottom subplot should display the vertical velocity while the projectile is in motion. A video of what your animation should look like is posted with this...

  • (1) (1 point) Write the vector form of velocity a function of v0, θ, t for...

    (1) (1 point) Write the vector form of velocity a function of v0, θ, t for when the projectile is in flight (before it hits the ground). (2) (1 point) Write the down horizontal and vertical displacements as a function of t, v0, θ. (3) (1 point) Give the expression for time of flight as a function of v0, θ, φ. (Hint: use previous results and tan(φ) = y/x) (4) (1 point) Give the expression for distance travelled along the...

  • Could somebody help me with this question for the coding on MATLAB? Thank you Projectile Motion...

    Could somebody help me with this question for the coding on MATLAB? Thank you Projectile Motion The distance a projectile travels when fired at an angle Θ is a function of time and can be divided into horizontal distance, dVotcos(O) and the vertical distance is dy Vot sin(0)-0.5gt2. Suppose a projectile is fired at an initial velocity of 100 m/s and a launch angle of /4 radians (45°). Use ezplot to graph horizontal distance on the x -axis and vertical...

  • Consider a projectile launched at a height h feet above the ground and at an angle θ with the hor...

    Consider a projectile launched at a height h feet above the ground and at an angle θ with the horizontal. If the initial velocity is v0 feet per second, the path of the projectile is modeled by the parametric equations x = t(v0 cos(θ)) and y = h + (v0 sin(θ))t − 16t2. The center field fence in a ballpark is 10 feet high and 400 feet from home plate. The ball is hit h = 2 feet above the...

  • Write a MATLAB Graphical User Interface (GUI) to simulate and plot the projectile motion – the...

    Write a MATLAB Graphical User Interface (GUI) to simulate and plot the projectile motion – the motion of an object projected into the air at an angle. The object flies in the air until the projectile returns to the horizontal axis (x-axis), where y=0. This MATLAB program should allow the user to try to hit a 2-m diameter target on the x-axis (y=0) by varying conditions, including the lunch direction, the speed of the lunch, the projectile’s size, and the...

  • EXPLORE A projectile is launched with a launch angle of 30° with respect to the horizontal...

    EXPLORE A projectile is launched with a launch angle of 30° with respect to the horizontal direction and with an initial speed of 40 m/s. (A) How do the vertical and horizontal components of the projectile's velocity vary with time? (B) How long does it remain in flight? (C) For a given launch speed, what launch angle produces the longest time of flight? CONCEPTUALIZE Consider the projectile to be a point mass that starts with an initial velocity, upward and...

  • I. A projectile is launched from point A with an initial velocity of vo and an...

    I. A projectile is launched from point A with an initial velocity of vo and an elevation angle θ as shown. The air resistance is neglected and gravitational acceleration is constant. a) Show that the equation of the path is y-2v zg+x tan θ, where g is the gravitational 2 2v6cos20 acceleration b) Determine the radius of curvature of the path in terms of the time t using n-t coordinate system c) For Vo-10 m/s and θ-40°, plot the radius...

  • I want the math lab code for theses problems in a unique way

    I want the math lab code for theses problems in a unique way Theory A projectile is launched from point A up an incline plane that makes an angle of 10 with the horizontal. The mountain is 6,000 m high. Vo 10° Figure 1: Flightpath of a projectile. If we neglect the air resistance, the flight path of a projectile launched at an initial speed vo and an angle θ of departure relative to the horizontal is a parabola (see...

  • EXPLORE A projectile is launched with a launch angle of 30° with respect to the horizontal...

    EXPLORE A projectile is launched with a launch angle of 30° with respect to the horizontal direction and with an initial speed of 10 m/s. s0 (A) How do the vertical and horizontal components of the projectile's velocity vary with time? 40 35 (B) How long does it remain in flight? 25 (C) For a given launch speed, what launch angle produces the longest time of flight? 15 10 toy CONCEPTUALIZE Consider the projectile to be a point mass that...

  • A man kicks the ball and ball does projectile motion with an angle of 53° to...

    A man kicks the ball and ball does projectile motion with an angle of 53° to horizontal. Its initial velocity is V = 10 m/s. a)Calculate the horizontal and vertical components of the initial velocity ............................................................................................ b) Calculate the total time tot required for the ball to reach the bottom c) Find the maximum height h that the ball can reach d) Calculate the horizontal displacement X

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT