Cody

# Problem 44952. Find MPG of Lightest Cars

Solution 2091351

Submitted on 13 Jan 2020 by Matt Cox
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Pass
N = 5 load(fullfile(matlabroot, 'toolbox/stats/statsdemos', 'carbig.mat')); Model = strtrim(string(Model)); cars = table(Model, MPG, Horsepower, Weight, Acceleration); save cars.mat cars assert(isequal(sort_cars(N),[35; 31; 39.1; 35.1; 31]));

N = 5 Weight = 1613 1649 1755 1760 1773 I = 62 152 351 353 61 mpg = 35.0000 31.0000 39.1000 35.1000 31.0000

2   Pass
N = 6 load(fullfile(matlabroot, 'toolbox/stats/statsdemos', 'carsmall.mat')); Model = strtrim(string(Model)); cars = table(Model, MPG, Horsepower, Weight, Acceleration); save cars.mat cars assert(isequal(sort_cars(N),[33; 29.5; 26; 29; 38; 32]));

N = 6 Weight = 1795 1825 1835 1937 1965 1965 I = 52 57 26 51 86 87 mpg = 33.0000 29.5000 26.0000 29.0000 38.0000 32.0000