11.07.2015 Views

Introduction to Sparse Matrices In Scilab - Projects

Introduction to Sparse Matrices In Scilab - Projects

Introduction to Sparse Matrices In Scilab - Projects

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

the non-zero entries of the matrix one at a time. Finally, we use the fullfunction <strong>to</strong> convert the sparse matrix in<strong>to</strong> a dense one.-->A = [-->1 2 0 0 0-->3 4 5 0 0-->0 6 7 8 0-->]A =1. 2. 0. 0. 0.3. 4. 5. 0. 0.0. 6. 7. 8. 0.-->B = sparse (A)B =( 3, 5) sparse matrix( 1, 1) 1.( 1, 2) 2.( 2, 1) 3.( 2, 2) 4.( 2, 3) 5.( 3, 2) 6.( 3, 3) 7.( 3, 4) 8.-->C = full (B)C =1. 2. 0. 0. 0.3. 4. 5. 0. 0.0. 6. 7. 8. 0.<strong>Sparse</strong> matrices can be real or complex. <strong>In</strong> the following session, we definea 3-by-5 complex matrix of doubles.-->A = [-->1 2 0 0 0-->3 4 5 0 0-->0 6 7 8 0-->];-->B = [-->9 10 0 0 0-->11 12 13 0 0-->0 14 15 16 0-->];-->C= complex (A,B)C =1. + 9.i 2. + 10. i 0 0 03. + 11. i 4. + 12. i 5. + 13. i 0 00 6. + 14. i 7. + 15. i 8. + 16. i 07

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!