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 commentsGroup

Matrix Manipulation I
- 16 Problems
- 98 Finishers
- Remove the air bubbles
- Remove NaN ?
- N-Dimensional Array Slice
- Back to basics 21 - Matrix replicating
- Back to basics 23 - Triangular matrix
- Make an awesome ramp for a tiny motorcycle stuntman
- Flip the main diagonal of a matrix
- surrounded matrix
- Some Assembly Required
- Set some matrix elements to zero
- Matrix with different incremental runs
- Removing rows from a matrix is easy - but what about inserting rows?
- Rotate input square matrix 90 degrees CCW without rot90
- Permute diagonal and antidiagonal
- Operate on matrices of unequal, yet similar, size
- Reverse the elements of an array
Problem Recent Solvers6724
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!