Answered step by step
Verified Expert Solution
Question
1 Approved Answer
A local manufacturing company wants to find out the total time it takes to deliver its products to retail stores from its manufacturing plant. The
A local manufacturing company wants to find out the total time it takes to deliver its products to retail stores from its manufacturing plant. The company has 2 delivery trucks for this purpose. Truck can travel at a speed of 54 km/hr and truck 2 can travel at 28 km/hr. The trucks go from store to store delivering the products and the trucks return to the factory. All deliveries have been made. (Southwest) Southeast) The locations of the retail stores are given as a set of kilometers west/east and north/south. For example, (0,-15) means that the truck is only moving south 15 km or (-10, 30) means that the truck is moving west 10 km and north 30 km. The trucks depart from the factory at the same time and travel from one store to another until they eventually return to the original starting point. Make sure to account for the distance needed to travel back to the starting point/factory. Each coordinate set is the distance from the starting point to the retail store Part1: Write a MATLAB function that will use a given pair of coordinates to determine: For this The absolute distance (ie. straight-line distance) of a given store from another store. calculation, recall the Pythagorean Theoremabc The time it takes for a truck to cover this distance for any given speed. 1- 2. Part 2: Write a MATLAB script that utilizes the function from Part 1 and does the following 1. Reads in the data from TravelingTruckslcsv. The file will contain 4 columns: a. Column 1: Truck 1 westleast b. Column 2: Truck 1 north/south Column 3: Truck 2 west/east c. d. Column 4: Truck 2 north/south Outputs to travelingtrucks.txt, the total distance and time covered by both trucks for the full trip both individually and combined. The distance value should be in kilometers and accurate to two decimal places (c.g., 1.34 km). Make sure to account for the distance needed to travel back to the starting point/factory. Be sure to use w' for permission, not'a', in the fopen statement. 2. 3. To the same txt file, outputs which truck arrives back to the factory first. 4. Generate a single plot showing the paths travelled by both trucks. A local manufacturing company wants to find out the total time it takes to deliver its products to retail stores from its manufacturing plant. The company has 2 delivery trucks for this purpose. Truck can travel at a speed of 54 km/hr and truck 2 can travel at 28 km/hr. The trucks go from store to store delivering the products and the trucks return to the factory. All deliveries have been made. (Southwest) Southeast) The locations of the retail stores are given as a set of kilometers west/east and north/south. For example, (0,-15) means that the truck is only moving south 15 km or (-10, 30) means that the truck is moving west 10 km and north 30 km. The trucks depart from the factory at the same time and travel from one store to another until they eventually return to the original starting point. Make sure to account for the distance needed to travel back to the starting point/factory. Each coordinate set is the distance from the starting point to the retail store Part1: Write a MATLAB function that will use a given pair of coordinates to determine: For this The absolute distance (ie. straight-line distance) of a given store from another store. calculation, recall the Pythagorean Theoremabc The time it takes for a truck to cover this distance for any given speed. 1- 2. Part 2: Write a MATLAB script that utilizes the function from Part 1 and does the following 1. Reads in the data from TravelingTruckslcsv. The file will contain 4 columns: a. Column 1: Truck 1 westleast b. Column 2: Truck 1 north/south Column 3: Truck 2 west/east c. d. Column 4: Truck 2 north/south Outputs to travelingtrucks.txt, the total distance and time covered by both trucks for the full trip both individually and combined. The distance value should be in kilometers and accurate to two decimal places (c.g., 1.34 km). Make sure to account for the distance needed to travel back to the starting point/factory. Be sure to use w' for permission, not'a', in the fopen statement. 2. 3. To the same txt file, outputs which truck arrives back to the factory first. 4. Generate a single plot showing the paths travelled by both trucks
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started