Problem 691. Number of bytes required to store a sparse matrix
Test Suite case 4 is a Diagonal Sparse matrix which is not a problem defined Sparse matrix and should be replaced by x = sparse(1000,100,0.01);
y_correct = 4016;.
Also, your inventive cheat detect needs to add assert(isempty(strfind(filetext, 'who'))). A re-scoring will see a new leader.
Currently Tests 4 and 5 are always pass as they lack asserts.
Enjoying the challenge.
yup, definitely need some asserts
@Richard, Thanks for your comments. I have added the assert with who and rescored all solutions.
All values at the test suite are currently wrong. Using whos in the first case, for instance, we obtain 8024 bytes and not 4016.
The values in the test suites have been corrected.
Solution CommentsShow comments
Problem Recent Solvers3
Return the largest number that is adjacent to a zero
Which values occur exactly three times?
How to find the position of an element in a vector without using the find function
Flip the main diagonal of a matrix
More from this Author30
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!