The input will be a sparse matrix :
x = sparse(100,1000,0.01);
>>whos x
shows that 8024 bytes ares required .
The aim is to find the the number of bytes required to store a sparse matrix in a 64-bit system without using whos or who commands.
Solution Stats
Problem Comments
5 Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers7
Suggested Problems
-
The Hitchhiker's Guide to MATLAB
3414 Solvers
-
We love vectorized solutions. Problem 1 : remove the row average.
893 Solvers
-
Vector of numbers divisible by 3
154 Solvers
-
Convert a Cell Array into an Array
2301 Solvers
-
Find Out sum of principal diagonal element of given matrix
258 Solvers
More from this Author30
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
Aurelien,
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.