matio-1.5.30/test/matlab/test_write_sparse.m
raw| 1 | try |
| 2 | load test_write_sparse.mat |
| 3 | expdata = zeros(5,10); |
| 4 | expdata(1:4:end,1:2:end) = 1; |
| 5 | expdata(2:4,2:2:end) = 1; |
| 6 | expdata = expdata.*reshape(1:50,5,10); |
| 7 | pass = true; |
| 8 | pass = pass && isa(sparse_matrix,class(expdata)); |
| 9 | pass = pass && issparse(sparse_matrix); |
| 10 | pass = pass && all(size(sparse_matrix)==size(expdata)); |
| 11 | pass = pass && all(sparse_matrix(:)==expdata(:)); |
| 12 | catch me |
| 13 | pass = false; |
| 14 | end |
| 15 | if pass |
| 16 | fprintf('PASSED\n'); |
| 17 | else |
| 18 | fprintf('FAILED\n'); |
| 19 | end |
| 20 | exit; |