Suppose I create this sparse matrix, where the non-zero elements consist of booleans 'true':
s = sparse([3 2 3 3 3 3 2 34 3 6 3 2 3 3 3 3 2 3 3 6], [10235 11470 21211 33322 49297 88361 91470 127422 152383 158751 166485 171471 181211 193321 205548 244609 251470 283673 312384 318752], true);
which contains 20 elements. Matlab ought to allocates no more than (4+4+1)*20 = 180 bytes of memory (it looks like the indices are 4 bytes long). Yet
whos s
says that the matrix takes up 1275112 bytes in memory, which is a problem as I need to store many thousands of these.
Any idea why this happens?
Cheers!