Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

% Initialization clear % clears base workspace hold on; % allows successive plotting in one plot batAngle = 45; % optimum swing angle heightGreenMonster =

% Initialization clear % clears base workspace hold on; % allows successive plotting in one plot batAngle = 45; % optimum swing angle heightGreenMonster = 11.3; % height of Green Monster wall distanceGreenMonster = 96; % distance of Green Monster wall heightSwing = 1.0; % swing height of batter in meters

% Special plot function to show batter and wall heights stem([0,distanceGreenMonster],[heightSwing,heightGreenMonster],.... "MarkerFaceColor","green"); ballVelocity=20; % velocity of ball = 20 m/sec [ x, y] = Trajectory(batAngle, ballVelocity); y = heightSwing + y; % adjust vertical with batters swing height ProcessData(x, y);

ballVelocity=25; % velocity of ball = 25 m/sec [ x, y] = Trajectory(batAngle, ballVeelocity); ProcessData(x, heightSwing + y);

ballVelocity=30; % velocity of ball = 30 m/sec [ x, y] = Trajectory(batAngle, ballVelocity); ProcessData(x, heightSwing + y);

ballVelocity=32.5; % velocity of ball = 32.5 m/sec [ x, y] = Trajectory(batAngle,ballVelocity ); ProcessData(x, heightSwing + y); hold off

function [ x, y] = Trajectory(batAngle, ballVelocity) % Trajectory Calculation gravity = 9.8; tFlight = (2 * ballVelocity * sind(batAngle)) / gravity; time = linspace(0, tFlight, 1000);

x = ballVelocity * cosd(batAngle) * time; y = (ballVelocity * sind(batAngle) * time)... - ((gravity * (time.^2))/ 2); end

function Process_Data(batAngle, ballVelocity, x, y) % Process Data gravity = 9.8; xMax = max(x); yMax = max(y); figure(1); plot(x,y); axis([0, 1.1*xMax, 0, 1.1*yMax]); xlabel("Distance in meters"); ylabel("Height in meters") end

function Trajectory_and_Process(batAngle, ballVelocity) % Calculate trajectory [x, y] = Trajectory(batAngle, ballVelocity); % Process Data Process_Data(batAngle, ballVelocity, x, y); end

  1. Re-write this Live script to determine what ball speed is required to clear the Green Monster. Correct script errors and make it run.
    1. This is run in matlab

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction to Managerial Accounting

Authors: Peter C. Brewer, Ray H. Garrison, Eric Noreen, Suresh Kalagnanam, Ganesh Vaidyanathan

5th Canadian edition

77429494, 1259105709, 1260480798, 978-1259105708

Students also viewed these Accounting questions