-
3 Comments
I do not understand why this code failed assertion test even though it yields the correct answer
function mpg = sort_cars(N)
load cars.mat
sorted = sortrows (cars,4)
n = N
mpg = sorted(1:n,2)
end
The output is expected to be a column vector, whereas your code returns a table.
I tried for the solution nearly 20 ways but didn't work. finally took help from the Matlab community and compleated it
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!