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
ans =
5×5 table
<strong>Model</strong> <strong>MPG</strong> <strong>Horsepower</strong> <strong>Weight</strong> <strong>Acceleration</strong>
<strong>_____________________</strong> <strong>____</strong> <strong>__________</strong> <strong>______</strong> <strong>____________</strong>
"datsun 1200" 35 69 1613 18
"toyota corona" 31 52 1649 16.5
"toyota starlet" 39.1 58 1755 16.9
"honda civic 1300" 35.1 60 1760 16.1
"toyota corolla 1200" 31 65 1773 19
ans =
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
ans =
6×5 table
<strong>Model</strong> <strong>MPG</strong> <strong>Horsepower</strong> <strong>Weight</strong> <strong>Acceleration</strong>
<strong>______________________________</strong> <strong>____</strong> <strong>__________</strong> <strong>______</strong> <strong>____________</strong>
"honda civic" 33 53 1795 17.4
"volkswagen rabbit" 29.5 71 1825 12.2
"volkswagen 1131 deluxe sedan" 26 46 1835 20.5
"volkswagen rabbit" 29 70 1937 14.2
"honda civic" 38 67 1965 15
"honda civic (auto)" 32 67 1965 15.7
ans =
33.0000
29.5000
26.0000
29.0000
38.0000
32.0000
|
1600 Solvers
480 Solvers
Sum the 'edge' values of a matrix
232 Solvers
555 Solvers
143 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!