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

Project Euler II
- 12 Problems
- 51 Finishers
- Find the longest sequence of 1's in a binary sequence.
- Convert given decimal number to binary number.
- Find out sum and carry of Binary adder
- Binary numbers
- Given an unsigned integer x, find the largest y by rearranging the bits in x
- Bit Reversal
- Relative ratio of "1" in binary number
- Binary code (array)
- Converting binary to decimals
- There are 10 types of people in the world
Problem Recent Solvers6722
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!