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 Solvers6724
Suggested Problems
-
Find the sum of all the numbers of the input vector
50382 Solvers
-
25982 Solvers
-
Implement a bubble sort technique and output the number of swaps required
321 Solvers
-
522 Solvers
-
Calculate the Number of Sign Changes in a Row Vector (No Element Is Zero)
768 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!