Marathon to mile pace (parse string and use results for calculation) My Solutions Code has already been provided to defi

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

Marathon to mile pace (parse string and use results for calculation) My Solutions Code has already been provided to defi

Post by answerhappygod »

Marathon To Mile Pace Parse String And Use Results For Calculation My Solutions Code Has Already Been Provided To Defi 1
Marathon To Mile Pace Parse String And Use Results For Calculation My Solutions Code Has Already Been Provided To Defi 1 (46.03 KiB) Viewed 51 times
Marathon to mile pace (parse string and use results for calculation) My Solutions Code has already been provided to define a function named paceCalculator that accepts a single input variable marathonTime that expects a character array representing a runner's race time in hours:minutes:seconds format (HH:MM:SS). Add commands to the function that uses the information in this character array to compute the average mile pace time in decimal minutes and assigns the result to the output variable milePace. A marathon is 26.2 miles long. For an example calculation, if the total time is 03:45:16, then the average mile pace, P in units of minutes per mile would be calculated as: P=26.2miles3 hours (1 hour 60 min​)+45 min+16sec(60sec1 min​)​=8.5980 min/mile Solve this problem using vectorized code. Your code should not include the following MATLAB functions or keywords: if, for, while. Note the variable marathontime is defined as a function input. Do not overwrite the value in your code. Function 0 1 function milePace = paceCalculator(marathonTime) 2 \%Enter the commands for your function below Be sure to assign the value 3 \%to the output variable defined in the function command on line 1.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply