Sebastián Andrade Becerra - MATLAB Cody - MATLAB Central

Sebastián Andrade Becerra

20286
Rank
4
Badges
242
Score
1 – 22 of 22

Sebastián Andrade Becerra submitted a Comment to Problem 44952. Find MPG of Lightest Cars

For those with problems with the directory: Don't ask me but do this hack: function mpg = sort_cars(N) if 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 sorted = sortrows (cars,4); mpg = sorted(1:N,2); mpg=mpg{:,:} elseif 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 sorted = sortrows (cars,4); mpg = sorted(1:N,2); mpg=mpg{:,:} end end

on 1 Sep 2023

Sebastián Andrade Becerra received Solver badge for Solution 11934586

on 1 Sep 2023

1 – 22 of 22
Go to top of page