Problem 44952. Find MPG of Lightest Cars
Solution Stats
Problem Comments
-
39 Comments
There's two points I'd like to make.
First: in the catch block, you're trying to load carsmall.mat from .../statsdemos rather than .../statsdata; try the latter.
Second: you don't need to load either file in your solution. All you need to do is load a file called cars.mat in the current directory, and work with whatever data it contains. Where it comes from and whether it was originally carbig.mat, carsmall.mat or something else is wholly irrelevant. The test suite will make sure this file exists and contains sensible data; your solution does not need to worry about it.
All this is indicated in the problem description, too. It may be worth rereading that, and writing your solution based on the instructions given there.
Notes:
1.In the function, you need write this code "load cars.mat;". Then, you have a table variable:cars
2.The return values mpg is a double variable, not table variable.
should understand the use of table.
Solution Comments
Show commentsProblem Recent Solvers6706
Suggested Problems
-
17656 Solvers
-
2492 Solvers
-
Sum the numbers on the main diagonal
590 Solvers
-
519 Solvers
-
9564 Solvers
More from this Author13
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!