# Problem 56503. Cricket - Career Bowling Statistics

Given a vector s of strings representing a bowler's individual innings records, return their career statistics as a 3-element (numeric) row vector representing: average, strike rate, and economy rate. The strings will be in the standard form: "O-M-R-W", such as "31.4-8-123-4" to represent 31 overs and 4 balls, 8 maidens, 123 runs conceded, 4 wickets taken.
Note that overs can be given as integers ("31" meaning 31 complete overs) or as pseudo decimals ("31.4" meaning 31 overs and 4 balls). All overs can be assumed to be 6-balls. All other statistics will be integers.
Career statistics are defined as:
• Average = (total runs conceded) / (total wickets taken)
• SR = (total balls delivered) / (total wickets taken)
• Econ = (total runs conceded) / (total overs delivered)
(Note that economy is given as runs/over. However, it can be calculated as runs/ball then converted to runs/over, assuming 6 balls/over.)
For example:
s = ["23.1-8-55-5";"24-5-84-0"];
stats = bowlingstats(s)
stats =
27.8000 56.6000 2.9470
Here, the bowler has delivered 47.1 overs (= 47*6 + 1 = 282 + 1 = 283 balls), conceded 139 runs, and taken 5 wickets. Hence their average is 139/5 = 27.8, their strike rate is 283/5 = 56.6, and their economy rate is 139/47.1667 = 2.947. (Or equivalently, economy = 139/283 = 0.4912 runs/ball, which converts to 0.4912*6 = 2.947 runs/over.)

### Solution Stats

37.97% Correct | 62.03% Incorrect
Last Solution submitted on Aug 22, 2024

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!